hsy 3 months ago
parent
commit
12d8de3f31
100 changed files with 0 additions and 27293 deletions
  1. 0 189
      src/views/archives/bindRecord.vue
  2. 0 182
      src/views/archives/channel.vue
  3. 0 50
      src/views/archives/components/BindRecordTable.vue
  4. 0 102
      src/views/archives/components/DialogEditChannel.vue
  5. 0 174
      src/views/archives/components/DialogEditMemberCard.vue
  6. 0 196
      src/views/archives/components/DialogEditMemberSystemInterest.vue
  7. 0 747
      src/views/archives/department.vue
  8. 0 239
      src/views/archives/expenseRecord.vue
  9. 0 28
      src/views/archives/list.vue
  10. 0 298
      src/views/archives/memberCard.vue
  11. 0 499
      src/views/archives/serviceProjectSetting.vue
  12. 0 74
      src/views/archives/serviceSetting.vue
  13. 0 51
      src/views/archives/setting.vue
  14. 0 315
      src/views/content/article.vue
  15. 0 188
      src/views/content/components/UpdateCategory.vue
  16. 0 321
      src/views/content/contentConfig.vue
  17. 0 137
      src/views/content/editArticle.vue
  18. 0 502
      src/views/dataCenter/checkData.vue
  19. 0 595
      src/views/dataCenter/components/ArchivesModule.vue
  20. 0 143
      src/views/dataCenter/components/CompCheckData.vue
  21. 0 235
      src/views/dataCenter/components/DialogAddDataSet.vue
  22. 0 273
      src/views/dataCenter/components/DialogRegisterData.vue
  23. 0 272
      src/views/dataCenter/components/DialogRelevance.vue
  24. 0 265
      src/views/dataCenter/components/DialogReportData.vue
  25. 0 359
      src/views/dataCenter/components/DialogViewData.vue
  26. 0 208
      src/views/dataCenter/components/DiseaseVisitData.vue
  27. 0 376
      src/views/dataCenter/components/DiseaseVisitDataUpload.vue
  28. 0 92
      src/views/dataCenter/components/EditArchivesModule.vue
  29. 0 545
      src/views/dataCenter/components/EditQuestionTemplate.vue
  30. 0 278
      src/views/dataCenter/components/MedicalReportUpload.vue
  31. 0 144
      src/views/dataCenter/components/MonitoringData.vue
  32. 0 195
      src/views/dataCenter/components/MonitoringDataUpload.vue
  33. 0 218
      src/views/dataCenter/components/NeedsUpload.vue
  34. 0 965
      src/views/dataCenter/components/ProofTable.vue
  35. 0 778
      src/views/dataCenter/components/QuestionItem.vue
  36. 0 178
      src/views/dataCenter/components/UploadDataDialog.vue
  37. 0 342
      src/views/dataCenter/components/VisitsDataUpload.vue
  38. 0 78
      src/views/dataCenter/components/VisitsFillData.vue
  39. 0 165
      src/views/dataCenter/dataSet.vue
  40. 0 511
      src/views/dataCenter/template.vue
  41. 0 867
      src/views/dataCenter/uploadCheckData.vue
  42. 0 550
      src/views/dataCenter/uploadData.vue
  43. 0 3
      src/views/demand/apply.vue
  44. 0 142
      src/views/demand/category.vue
  45. 0 222
      src/views/demand/components/DialogEditDemand.vue
  46. 0 223
      src/views/demand/components/DialogHandle.vue
  47. 0 99
      src/views/demand/components/DialogService.vue
  48. 0 190
      src/views/demand/components/UpdateCategory.vue
  49. 0 278
      src/views/demand/index.vue
  50. 0 387
      src/views/myShop/AddGood copy.vue
  51. 0 476
      src/views/myShop/AddGood.vue
  52. 0 355
      src/views/myShop/Appeal.vue
  53. 0 213
      src/views/myShop/Category.vue
  54. 0 2
      src/views/myShop/EditGoods.vue
  55. 0 378
      src/views/myShop/Goods.vue
  56. 0 601
      src/views/myShop/Order copy.vue
  57. 0 600
      src/views/myShop/Order.vue
  58. 0 503
      src/views/myShop/OrderDetail.vue
  59. 0 135
      src/views/myShop/Recommend.vue
  60. 0 194
      src/views/myShop/Store.vue
  61. 0 109
      src/views/myShop/Subsidy.vue
  62. 0 157
      src/views/myShop/Swiper.vue
  63. 0 135
      src/views/myShop/components/DialogAddCategory.vue
  64. 0 263
      src/views/myShop/components/DialogAddSwiper.vue
  65. 0 183
      src/views/myShop/components/DialogCompleteOreder.vue
  66. 0 122
      src/views/myShop/components/DialogEditRecommend.vue
  67. 0 184
      src/views/myShop/components/DialogEditRecommendGood.vue
  68. 0 435
      src/views/myShop/components/DialogEditStore.vue
  69. 0 234
      src/views/myShop/components/DialogEditSubsidy.vue
  70. 0 98
      src/views/myShop/components/DialogExamineGoods.vue
  71. 0 190
      src/views/myShop/components/DialogExportOrder.vue
  72. 0 177
      src/views/myShop/components/DialogRecommendGood.vue
  73. 0 135
      src/views/myShop/components/DialogSecondaryCategory.vue
  74. 0 107
      src/views/myShop/components/DialogSettingStoreStatus.vue
  75. 0 145
      src/views/myShop/components/DialogSubsidyTarget.vue
  76. 0 100
      src/views/myShop/components/TradNote.vue
  77. 0 52
      src/views/myShop/purchaseNotice.vue
  78. 0 92
      src/views/physical/Components/Assess.vue
  79. 0 210
      src/views/physical/Components/DialogSurvey.vue
  80. 0 206
      src/views/physical/Components/DialogViewSurveyResult.vue
  81. 0 144
      src/views/physical/Components/EditArchivesModal.vue
  82. 0 217
      src/views/physical/Components/EditSurveyModal.vue
  83. 0 205
      src/views/physical/Components/EditSurveyResultModal.vue
  84. 0 125
      src/views/physical/Components/UserInfo.vue
  85. 0 23
      src/views/physical/index.vue
  86. 0 327
      src/views/physical/result.vue
  87. 0 228
      src/views/physical/survey.vue
  88. 0 87
      src/views/physical/surveyCmps/EditDatetimeCell.vue
  89. 0 21
      src/views/physical/surveyCmps/ExtendsQuestionItem.vue
  90. 0 937
      src/views/physical/surveyCmps/QuestionItem.vue
  91. 0 1217
      src/views/physical/surveyCmps/Questions.vue
  92. 0 754
      src/views/schemeLibrary/checkitemLibrary.vue
  93. 0 119
      src/views/schemeLibrary/components/DialogEditDiseaseGrade.vue
  94. 0 192
      src/views/schemeLibrary/components/DialogEditDiseaseManageGroup.vue
  95. 0 130
      src/views/schemeLibrary/components/DialogEditSuggestion.vue
  96. 0 101
      src/views/schemeLibrary/components/DialogEditTags.vue
  97. 0 210
      src/views/schemeLibrary/index.vue
  98. 0 261
      src/views/schemeLibrary/managementGroupBase.vue
  99. 0 270
      src/views/schemeLibrary/returnVisitTemplate.vue
  100. 0 466
      src/views/schemeLibrary/reviewTemplate.vue

+ 0 - 189
src/views/archives/bindRecord.vue

@@ -1,189 +0,0 @@
-<template>
-  <div>
-    <div>
-      <el-card class="mb-4" shadow="never">
-        <div>
-          <el-row :gutter="10">
-            <el-col :span="18">
-              <el-date-picker
-                v-model="state.times"
-                type="daterange"
-                clearable
-                range-separator="至"
-                value-format="YYYY-MM-DD"
-                start-placeholder="开始时间"
-                end-placeholder="结束时间"
-              />
-              <el-select
-                v-model="state.query.cardIds"
-                placeholder="全部会员卡"
-                filterable
-                clearable
-                multiple
-                class="ml-4 mr-4"
-              >
-                <el-option
-                  v-for="item in memberCardList"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.id"
-                >
-                  <template #default>
-                    <div>
-                      <span style="font-weight: bold">{{ item.name }} </span>
-                      <div class="text-sm text-gray-400" v-if="item.remark">
-                        {{ item.remark }}
-                      </div>
-                    </div>
-                  </template>
-                </el-option>
-              </el-select>
-
-              <el-select
-                v-model="state.query.channelNames"
-                placeholder="全部绑定的渠道"
-                filterable
-                clearable
-                multiple
-                class="mr-4"
-              >
-                <el-option
-                  v-for="(item, index) in channleNameList"
-                  :key="(item, index)"
-                  :label="item"
-                  :value="item"
-                />
-              </el-select>
-              <el-button type="primary" @click="onSearch">筛选</el-button>
-              <el-button type="primary" plain @click="onReset">重置</el-button>
-            </el-col>
-            <el-col :span="6" class="flex justify-end">
-              <el-input
-                v-model="state.query.value"
-                placeholder="请输入"
-                class="input-with-select"
-              >
-                <template #prepend>
-                  <el-select
-                    v-model="state.query.key"
-                    placeholder="请选择"
-                    style="width: 115px"
-                  >
-                    <el-option label="用户" value="user" />
-                    <el-option label="第三方订单" value="outTradeNo" />
-                  </el-select>
-                </template>
-                <template #append>
-                  <el-button :icon="Search" @click="onSearch">查询</el-button>
-                </template>
-              </el-input>
-            </el-col>
-          </el-row>
-        </div>
-      </el-card>
-      <BindRecordTable :list="state.list" />
-      <el-pagination
-        class="mt-4 justify-end"
-        background
-        layout="prev, pager, next"
-        :total="state.total"
-        :page-size="state.pageSize"
-        @current-change="changePage"
-      />
-    </div>
-  </div>
-</template>
-<script setup>
-import { request } from "@/utils";
-import { ref, computed, defineProps, defineEmits, watch, reactive } from "vue";
-import { Search } from "@element-plus/icons-vue";
-import BindRecordTable from "./components/BindRecordTable.vue";
-const state = reactive({
-  visible: false,
-  visibleSystemInterest: false,
-  rowData: {},
-  query: {
-    page: 1,
-    pageSize: 10, //
-    cardIds: [],
-    channelNames: [],
-    name: "", // 搜索项目:user: 用户;outTradeNo:第三方订单号
-    key: "user",
-    value: ""
-  },
-  times: [],
-  list: [],
-  total: 0
-});
-const memberCardList = ref([]);
-const channleNameList = ref([]);
-
-const getBindRecords = () => {
-  let start = undefined;
-  let end = undefined;
-  if (state.times?.length > 0) {
-    start = state.times[0];
-    end = state.times[1];
-  }
-  request
-    .get("walletService/mechanism/membershipCard/bindLog/paginate", {
-      params: {
-        ...state.query,
-        cardIds: state.query.cardIds.join(","),
-        channelNames: state.query.channelNames.join(","),
-        start,
-        end
-      }
-    })
-    .then(resp => {
-      state.list = resp.data.list;
-      state.total = resp.data.total;
-    });
-};
-
-const getMemberCardList = () => {
-  request
-    .get("walletService/mechanism/membershipCard/list", {
-      params: { status: 1 }
-    })
-    .then(resp => {
-      memberCardList.value = resp.data;
-    });
-};
-const getChannleName = () => {
-  request
-    .get("walletService/mechanism/membershipCard/bindLog/channelNames", {})
-    .then(resp => {
-      channleNameList.value = resp.data;
-    });
-};
-const onSearch = () => {
-  state.query.page = 1;
-  getBindRecords();
-};
-const onReset = () => {
-  state.times = [];
-  state.query.channelNames = [];
-  state.query.cardIds = [];
-  state.query.times = [];
-  state.query.value = "";
-  state.query.key = "";
-  onSearch();
-};
-const changePage = page => {
-  state.query.page = page;
-  getBindRecords();
-};
-const initData = () => {
-  getMemberCardList();
-  getChannleName();
-  getBindRecords();
-};
-initData();
-</script>
-<style lang="scss">
-.el-select-dropdown__item {
-  overflow: auto;
-  height: auto;
-}
-</style>

+ 0 - 182
src/views/archives/channel.vue

@@ -1,182 +0,0 @@
-<template>
-  <div class="page-channel">
-    <el-row :gutter="10" style="height: 90vh">
-      <el-col :span="6">
-        <el-card shadow="never" class="h-full">
-          <template #header>
-            <div class="flex items-center justify-between">
-              <div class="flex items-center">
-                <el-input
-                  v-model.trim="query.key"
-                  clearable
-                  placeholder="输入渠道名称进行搜索"
-                />
-                <el-button
-                  type="primary"
-                  class="ml-2"
-                  @click="onSearch"
-                  :icon="Search"
-                  >搜索</el-button
-                >
-              </div>
-              <el-button
-                type="primary"
-                :icon="Plus"
-                class="ml-2"
-                @click="
-                  state.visible = true;
-                  state.rowData = {
-                    id: undefined
-                  };
-                "
-                >新增渠道</el-button
-              >
-            </div>
-          </template>
-          <div>
-            <el-table
-              :data="state.list"
-              style="width: 100%"
-              :show-header="false"
-              max-height="85vh"
-              @row-click="
-                row => {
-                  state.currentChannel = row;
-                }
-              "
-            >
-              <el-table-column prop="name" label="姓名">
-                <template #default="{ row }">
-                  <div :class="state.currentChannel.id == row.id && 'active'">
-                    {{ row.name }}
-                  </div>
-                </template>
-              </el-table-column>
-            </el-table>
-
-            <el-pagination
-              background
-              class="justify-end mt-4"
-              layout="total, prev, pager, next"
-              :page-size="10"
-              :total="state.total"
-              @change="handleCurrentChange"
-            />
-          </div>
-        </el-card>
-      </el-col>
-      <el-col :span="18">
-        <el-card shadow="never" v-if="state.currentChannel.id" class="h-full">
-          <template #header>
-            <div class="flex items-center">
-              <el-text tag="b">{{ state.currentChannel.name }}</el-text>
-              <div class="ml-8">
-                <el-button type="primary" :icon="Edit" link @click="handleEdit"
-                  >编辑</el-button
-                >
-                <el-popconfirm
-                  title="确定要删除这个渠道吗?如果创建了部门,部门也会一并删除"
-                  width="300"
-                  @confirm="handleDelete"
-                >
-                  <template #reference>
-                    <el-button type="danger" :icon="Delete" link
-                      >删除</el-button
-                    >
-                  </template>
-                </el-popconfirm>
-              </div>
-            </div>
-          </template>
-          <div>
-            <PageDepartment
-              :channelId="state.currentChannel.id"
-              :channelName="state.currentChannel.name"
-            />
-          </div>
-        </el-card>
-        <el-card shadow="never" class="h-full" v-else>
-          <div>
-            <el-empty />
-          </div>
-        </el-card>
-      </el-col>
-    </el-row>
-    <DialogEditChannel
-      v-model:show="state.visible"
-      @success="onSearch"
-      :rowData="state.rowData"
-    />
-  </div>
-</template>
-<script lang="ts" setup>
-import { reactive } from "vue";
-import { Search, Plus, Edit, Delete } from "@element-plus/icons-vue";
-import DialogEditChannel from "./components/DialogEditChannel.vue";
-import PageDepartment from "./department.vue";
-
-import { request } from "@/utils";
-import { ElMessage } from "element-plus";
-
-const state = reactive({
-  visible: false,
-  list: [],
-  total: 0,
-  currentChannel: {
-    id: undefined,
-    name: ""
-  },
-  rowData: {}
-});
-const query = reactive({
-  key: "",
-  page: 1
-});
-const initCurrentChannel = () => {
-  state.currentChannel.id = "";
-  state.currentChannel.name = "";
-};
-const onSearch = () => {
-  query.page = 1;
-  getList();
-};
-const getList = () => {
-  request
-    .get("archivesService/mechanism/channel/paginate", { params: query })
-    .then(resp => {
-      state.list = resp.data.list;
-      state.total = resp.data.total;
-      if (state.currentChannel.id) {
-        state.currentChannel = state.list.find(
-          v => v.id == state.currentChannel.id
-        );
-      }
-    });
-};
-const handleCurrentChange = page => {
-  query.page = page;
-  getList();
-};
-const handleEdit = () => {
-  state.rowData = state.currentChannel;
-  state.visible = true;
-};
-const handleDelete = () => {
-  request
-    .post(
-      `archivesService/mechanism/channel/delete?id=${state.currentChannel.id}`
-    )
-    .then(resp => {
-      ElMessage.success(resp.message);
-      initCurrentChannel();
-      getList();
-    });
-};
-getList();
-</script>
-<style lang="scss" scoped>
-.active {
-  color: var(--el-color-primary);
-  border-right: 6px solid var(--el-color-primary);
-}
-</style>

+ 0 - 50
src/views/archives/components/BindRecordTable.vue

@@ -1,50 +0,0 @@
-<template>
-  <el-table :data="props.list" style="width: 100%" border>
-    <el-table-column prop="createdAt" label="业务发生时间" />
-    <el-table-column prop="archiveId" label="用户信息">
-      <template #default="{ row }">
-        <div>
-          <div>{{ row.archiveName }}</div>
-          <div>{{ row.archiveId }}</div>
-        </div>
-      </template>
-    </el-table-column>
-    <el-table-column prop="afterCardId" label="业务类型">
-      <template #default="{ row }">
-        <div>
-          <div>{{ !!row.afterCardId ? "绑定" : "取消绑定" }}</div>
-        </div>
-      </template>
-    </el-table-column>
-    <el-table-column prop="channelName" label="购买渠道名称" />
-    <el-table-column prop="price" label="支付金额">
-      <template #default="{ row }">
-        <div>
-          <div>{{ !row.afterCardId ? "-" : row.price / 100 }}</div>
-        </div>
-      </template>
-    </el-table-column>
-    <el-table-column prop="payType" label="支付方式" />
-    <el-table-column prop="outTradeNo" label="第三方订单号" />
-    <el-table-column prop="remark" label="备注信息" />
-    <el-table-column prop="previousCardName" label="操作前绑定的会员卡名称" />
-    <el-table-column prop="afterCardName" label="操作后绑定的会员卡名称" />
-    <el-table-column prop="afterCardName" label="操作人">
-      <template #default="{ row }">
-        <div>
-          <div>{{ row.operatorName }}({{ row.operatorId }})</div>
-          <div />
-        </div>
-      </template>
-    </el-table-column>
-  </el-table>
-</template>
-<script setup>
-import { defineProps } from "vue";
-const props = defineProps({
-  list: {
-    type: Array,
-    default: () => []
-  }
-});
-</script>

+ 0 - 102
src/views/archives/components/DialogEditChannel.vue

@@ -1,102 +0,0 @@
-<template>
-  <div>
-    <el-dialog title="渠道设置" v-model="dialogVisible">
-      <div>
-        <el-form ref="formRef" :model="form" label-width="80px">
-          <el-form-item
-            label="渠道名称"
-            prop="name"
-            :rules="[
-              {
-                required: true,
-                message: '请输入机构名称',
-                trigger: 'blur'
-              }
-            ]"
-          >
-            <el-input
-              v-model="form.name"
-              placeholder="请输入机构名称"
-              clearable
-            ></el-input>
-          </el-form-item>
-          <el-form-item label="备注信息" prop="remark">
-            <el-input
-              v-model="form.remark"
-              placeholder="请输入备注"
-              type="textarea"
-              clearable
-              :rows="8"
-            ></el-input>
-          </el-form-item>
-        </el-form>
-      </div>
-      <template #footer>
-        <div>
-          <el-button @click="dialogVisible = false">取 消</el-button>
-          <el-button type="primary" @click="onSubmit">确 定</el-button>
-        </div>
-      </template>
-    </el-dialog>
-  </div>
-</template>
-<script lang="ts" setup>
-import { request } from "@/utils";
-import { ElMessage } from "element-plus";
-import { ref, computed, defineProps, defineEmits, watch, reactive } from "vue";
-const props = defineProps({
-  show: {
-    type: Boolean,
-    default: false
-  },
-  rowData: {
-    type: Object,
-    default: () => {}
-  }
-});
-const emits = defineEmits(["update:show", "success"]);
-const dialogVisible = computed({
-  get() {
-    return props.show;
-  },
-  set(n) {
-    emits("update:show", n);
-  }
-});
-
-watch(
-  () => dialogVisible.value,
-  n => {
-    if (n) {
-      if (props.rowData?.id) {
-        form.name = props.rowData.name;
-        form.remark = props.rowData.remark;
-        form.id = props.rowData.id;
-      }
-    } else {
-      formRef.value.resetFields();
-      form.id = undefined;
-    }
-  }
-);
-const form = reactive({
-  name: "",
-  remark: "",
-  id: undefined
-});
-const formRef = ref();
-
-const onSubmit = () => {
-  formRef.value.validate(valid => {
-    if (!valid) return;
-    let api = form.id
-      ? "archivesService/mechanism/channel/update"
-      : "archivesService/mechanism/channel/create";
-    request.post(api, form).then(resp => {
-      ElMessage.success(resp.message);
-      dialogVisible.value = false;
-      emits("success");
-    });
-  });
-};
-</script>

+ 0 - 174
src/views/archives/components/DialogEditMemberCard.vue

@@ -1,174 +0,0 @@
-<template>
-  <div>
-    <el-dialog title="会员卡设置" v-model="dialogVisible">
-      <div>
-        <el-form ref="formRef" :model="form" label-width="120px">
-          <el-form-item
-            label="会员卡名称"
-            :rules="[
-              {
-                required: true,
-                message: '请输入会员卡名称',
-                trigger: 'blur'
-              }
-            ]"
-            prop="name"
-          >
-            <el-input
-              v-model="form.name"
-              placeholder="请输入会员卡名称"
-              clearable
-            />
-          </el-form-item>
-          <el-form-item label="副标题" prop="title">
-            <el-input
-              v-model="form.title"
-              placeholder="请输入副标题"
-              clearable
-            />
-          </el-form-item>
-          <el-form-item
-            label="有效期"
-            :rules="[
-              {
-                required: true,
-                message: '请输入有效期天数',
-                trigger: 'blur'
-              }
-            ]"
-            prop="lifespan"
-          >
-            <el-input
-              v-model="form.lifespan"
-              placeholder="请输入天数"
-              clearable
-            >
-              <template #suffix>
-                <span>天</span>
-              </template>
-            </el-input>
-          </el-form-item>
-          <el-form-item
-            label="价格"
-            :rules="[
-              {
-                required: true,
-                message: '请输入价格',
-                trigger: 'blur'
-              }
-            ]"
-            prop="price"
-          >
-            <el-input v-model="form.price" placeholder="请输入价格" clearable>
-              <template #suffix>
-                <span>元</span>
-              </template>
-            </el-input>
-          </el-form-item>
-          <el-form-item label="备注信息" prop="remark">
-            <el-input
-              v-model="form.remark"
-              placeholder="请输入备注信息"
-              type="textarea"
-              clearable
-            />
-          </el-form-item>
-          <el-form-item label="会员权益" prop="content">
-            <Editor v-model:value="form.content" />
-          </el-form-item>
-        </el-form>
-      </div>
-      <template #footer>
-        <div>
-          <el-button @click="dialogVisible = false">取 消</el-button>
-          <el-button type="primary" @click="onSubmit">确 定</el-button>
-        </div>
-      </template>
-    </el-dialog>
-  </div>
-</template>
-<script lang="ts" setup>
-import Editor from "@/components/Editor.vue";
-import { request } from "@/utils";
-import { ElMessage } from "element-plus";
-import { ref, computed, defineProps, defineEmits, watch, reactive } from "vue";
-const props = defineProps({
-  show: {
-    type: Boolean,
-    default: false
-  },
-  rowData: {
-    type: Object,
-    default: () => {}
-  }
-});
-const emits = defineEmits(["update:show", "success"]);
-const dialogVisible = computed({
-  get() {
-    return props.show;
-  },
-  set(n) {
-    emits("update:show", n);
-  }
-});
-
-watch(
-  () => dialogVisible.value,
-  n => {
-    if (n) {
-      if (props.rowData?.id) {
-        const { name, lifespan, price, remark, content, id, title } =
-          props.rowData;
-        form.id = id;
-        form.name = name;
-        form.lifespan = lifespan;
-        form.price = price / 100;
-        form.remark = remark;
-        form.content = content;
-        form.title = title;
-        console.log("form", form);
-      } else {
-        form.id = undefined;
-        form.name = "";
-        form.lifespan = "";
-        form.price = undefined;
-        form.remark = "";
-        form.content = "";
-        form.title = "";
-      }
-    } else {
-      formRef.value.resetFields();
-    }
-  }
-);
-
-const formRef = ref();
-const form = reactive({
-  id: undefined,
-  name: "",
-  lifespan: "",
-  title: "",
-  price: undefined,
-  remark: "",
-  content: ""
-});
-const onSubmit = () => {
-  formRef.value.validate(valid => {
-    if (!valid) return;
-    request
-      .post(
-        `walletService/mechanism/membershipCard${form.id ? "/update" : ""}`,
-        {
-          ...form,
-          price: Number(form.price) * 100,
-          lifespan: Number(form.lifespan)
-        }
-      )
-      .then(resp => {
-        ElMessage.success(resp.message);
-        dialogVisible.value = false;
-        emits("success");
-      });
-  });
-};
-</script>

+ 0 - 196
src/views/archives/components/DialogEditMemberSystemInterest.vue

@@ -1,196 +0,0 @@
-<template>
-  <div>
-    <el-dialog title="权益设置" v-model="dialogVisible">
-      <div>
-        <div
-          class="text-lg mb-4 font-bold bg-gray-200 text-red-400 py-4 px-2 rounded"
-        >
-          提示:修改项目内容或者服务次数,只会对后续绑定用户生效,已绑定用户延用绑定那一刻的配置,不会因为修改而更改
-        </div>
-        <el-space direction="vertical" alignment="flex-start" :size="0">
-          <div class="text-base font-bold mb-2">上传报告</div>
-          <div class="text-sm">
-            <el-text
-              >启用该服务:
-              <el-switch
-                v-model="form.uploadReport"
-                :inactive-value="0"
-                :active-value="1"
-            /></el-text>
-          </div>
-          <div class="text-sm">
-            <el-text>服务有效期内可上传:</el-text>
-            <el-radio-group v-model="uploadReportType">
-              <el-radio :label="-1">不限次数</el-radio>
-              <el-radio :label="1">有限次数</el-radio>
-            </el-radio-group>
-            <el-input-number
-              class="ml-1"
-              v-model="form.uploadReportTimes"
-              :min="0"
-            />
-            次
-          </div>
-          <div class="mt-2">
-            <span class="text-xs">说明:个人和家人公用该上传次数设置</span>
-          </div>
-        </el-space>
-        <el-divider />
-        <el-space direction="vertical" alignment="flex-start" :size="0">
-          <div class="text-base font-bold mb-2">添加家人</div>
-          <div class="text-sm">
-            <el-text
-              >启用该服务:
-              <el-switch
-                v-model="form.addFamily"
-                :active-value="1"
-                :inactive-value="0"
-            /></el-text>
-          </div>
-          <div class="text-sm">
-            <el-text>服务有效期内可添加:</el-text>
-            <el-input-number v-model="form.addFamilyTimes" :min="0" />
-            个家人
-          </div>
-          <div class="mt-2">
-            <span class="text-xs"
-              >说明:该可添加人数与用户实际已添加人数共享,例如该会员卡设置为3个家人,而用户在绑定该卡时已创建过2个家人,则该用户该卡有效期内还能再添加1个家人</span
-            >
-          </div>
-        </el-space>
-        <el-divider />
-        <el-space direction="vertical" alignment="flex-start" :size="0">
-          <div class="text-base font-bold mb-2">私人健康管家</div>
-          <div class="text-sm mb-2">
-            <el-text
-              >启用服务:
-              <el-switch
-                v-model="form.healthManager"
-                :inactive-value="0"
-                :active-value="1"
-            /></el-text>
-          </div>
-          <div class="text-sm flex">
-            <span class="text-sm flex-shrink-0">配置:</span>
-            <!-- <Editor v-model="form.weComContent" /> -->
-            <el-upload
-              class="avatar-uploader"
-              :show-file-list="false"
-              :before-upload="beforeAvatarUpload"
-              :http-request="simpleImgHttpUpload"
-            >
-              <img
-                v-if="form.weComContent"
-                :src="form.weComContent"
-                class="avatar"
-              />
-              <el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
-            </el-upload>
-          </div>
-        </el-space>
-      </div>
-      <template #footer>
-        <div>
-          <el-button @click="dialogVisible = false">取 消</el-button>
-          <el-button type="primary" @click="onSubmit">确 定</el-button>
-        </div>
-      </template>
-    </el-dialog>
-  </div>
-</template>
-<script setup lang="ts">
-import { request, uploadToOSS } from "@/utils";
-import { ElMessage } from "element-plus";
-import { Plus } from "@element-plus/icons-vue";
-
-import type { UploadProps } from "element-plus";
-
-import { ref, computed, defineProps, defineEmits, watch, reactive } from "vue";
-const props = defineProps({
-  show: {
-    type: Boolean,
-    default: false
-  },
-  rowData: {
-    type: Object,
-    default: () => {}
-  }
-});
-const emits = defineEmits(["update:show", "success"]);
-const dialogVisible = computed({
-  get() {
-    return props.show;
-  },
-  set(n) {
-    emits("update:show", n);
-  }
-});
-
-watch(
-  () => dialogVisible.value,
-  n => {
-    if (n) {
-      console.log("props.rowData", props.rowData);
-
-      if (props.rowData?.id) {
-        form.id = props.rowData?.id;
-        form.uploadReport = props.rowData?.uploadReport;
-        form.uploadReportTimes = props.rowData?.uploadReportTimes;
-        form.addFamily = props.rowData?.addFamily;
-        form.addFamilyTimes = props.rowData?.addFamilyTimes;
-        form.healthManager = props.rowData?.healthManager;
-        form.weComContent = props.rowData?.weComContent;
-        uploadReportType.value =
-          props.rowData.uploadReportTimes === -1 ? -1 : 1;
-      }
-    }
-  }
-);
-
-const form = reactive({
-  id: undefined,
-  uploadReport: 1, //是否开启上传:0:关闭;1:打开
-  uploadReportTimes: 0, //可上传次数:-1:不限次数;
-  addFamily: 0,
-  addFamilyTimes: 0, // 可添加家人数
-  healthManager: 0, //是否开启私人健康管家
-  weComContent: "" // 企业微信富文本
-});
-const uploadReportType = ref(-1);
-const onSubmit = () => {
-  request
-    .post(`walletService/mechanism/membershipCard/systemInterest`, {
-      ...form,
-      uploadReportTimes:
-        uploadReportType.value === -1 ? -1 : form.uploadReportTimes
-    })
-    .then(resp => {
-      ElMessage.success(resp.message);
-      dialogVisible.value = false;
-      emits("success");
-    });
-};
-const beforeAvatarUpload: UploadProps["beforeUpload"] = rawFile => {
-  if (!["image/png", "image/jpeg"].includes(rawFile.type)) {
-    ElMessage.error("Avatar picture must be JPG format!");
-    return false;
-  } else if (rawFile.size / 1024 / 1024 > 50) {
-    ElMessage.error("图片不能超过 50MB!");
-    return false;
-  }
-  return true;
-};
-
-const simpleImgHttpUpload = options => {
-  uploadToOSS(options.file, options.file.name).then(resp => {
-    form.weComContent = resp;
-  });
-};
-</script>
-<style lang="scss">
-.avatar-uploader .avatar {
-  width: 178px;
-  height: 178px;
-  display: block;
-}
-</style>

+ 0 - 747
src/views/archives/department.vue

@@ -1,747 +0,0 @@
-<template>
-  <div>
-    <div class="mb-4 flex item-center justify-between">
-      <div>
-        <el-button type="primary" @click="showEditDepartment"
-          >新建部门</el-button
-        >
-        <el-button
-          @click="
-            importUploadState = false;
-            importDialogVisible = true;
-          "
-          >一键导入部门与人员信息</el-button
-        >
-        <el-button
-          @click="
-            visibleLastTimeImport = true;
-            getImportProgress();
-          "
-          >最近1次导入信息</el-button
-        >
-      </div>
-      <div class="text-right w-1/2 flex items-center">
-        <el-select v-model="filter.type" placeholder="">
-          <el-option label="搜部门" :value="1"> </el-option>
-          <el-option label="搜人员" :value="2"> </el-option>
-        </el-select>
-        <el-input
-          v-if="filter.type == 1"
-          v-model="filter.key"
-          class="w-full"
-          placeholder="请输入关键词"
-          clearable
-        >
-        </el-input>
-        <SearchArchivesSelect
-          v-else
-          style="width: 100%"
-          v-model="filter.archivesId"
-          :channelIds="props.channelId"
-          placeholder="请选择档案"
-          @change="handleChangeArchivesId"
-        />
-        <div class="ml-2 flex">
-          <el-button type="primary" @click="onSearch">搜索</el-button>
-          <el-button type="primary" plain @click="onReset">重置</el-button>
-        </div>
-      </div>
-    </div>
-    <el-table :data="departments" row-key="id" default-expand-all>
-      <el-table-column prop="name" label="部门名称">
-        <template #default="{ row }">
-          <template v-if="filter.type == 1">
-            <span v-html="hightLight(filter.key, row.name)"></span>
-          </template>
-          <template v-if="filter.type == 2">
-            <span
-              v-if="filter.archivesId"
-              :style="{
-                color:
-                  currentArchivesInfo?.departmentId == row.id ? '#67C23A' : ''
-              }"
-              >{{ row.name }}</span
-            >
-            <span v-else>{{ row.name }}</span>
-          </template>
-        </template>
-      </el-table-column>
-      <el-table-column prop="archivesTotal" label="部门人数"></el-table-column>
-      <el-table-column label="操作">
-        <template #default="{ row }">
-          <el-button type="primary" link @click="showEditDepartment(row)"
-            >编辑</el-button
-          >
-          <el-button
-            type="primary"
-            link
-            @click="showPersonnelManagementVisible(row)"
-            >人员管理</el-button
-          >
-          <el-button type="danger" link @click="deleteDepartment(row)"
-            >删除</el-button
-          >
-        </template>
-      </el-table-column>
-    </el-table>
-    <el-pagination
-      background
-      class="justify-end mt-4"
-      layout="total, prev, pager, next"
-      :page-size="10"
-      :total="totalDepartments"
-      @change="handleCurrentChange"
-    ></el-pagination>
-
-    <el-dialog v-model="editDepartmentVisible" title="编辑部门">
-      <h3 class="my-4">{{ props.channelName }}</h3>
-
-      <el-form :label-width="100">
-        <el-form-item label="部门名称" required>
-          <el-input
-            v-model="editDepartment.name"
-            placeholder="请输入部门名称"
-          ></el-input>
-        </el-form-item>
-        <el-form-item label="部门所属" required>
-          <el-select
-            v-model="editDepartment.departmentId"
-            filterable
-            placeholder="请选择"
-          >
-            <el-option label="无所属部门" :value="undefined"></el-option>
-            <el-option
-              v-for="item in treeDepartmentData"
-              :key="item.id"
-              :label="item.name"
-              :value="item.id"
-            >
-            </el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="排序">
-          <el-input
-            v-model="editDepartment.sort"
-            type="number"
-            placeholder="请输入值,值越大,在同属部门下排序越靠前"
-          ></el-input>
-        </el-form-item>
-      </el-form>
-      <template #footer>
-        <el-button
-          type="primary"
-          :disabled="!editDepartment.name"
-          @click="saveDepartment"
-          >保存</el-button
-        >
-      </template>
-    </el-dialog>
-    <el-dialog v-model="visibleLastTimeImport">
-      <template v-if="!importProgress.errorList.length">
-        <div class="flex justify-center items-center" style="height: 300px">
-          <div>
-            <div class="flex items-center">
-              <SuccessFilled
-                class="text-green-600"
-                style="height: 30px; width: 30px"
-              ></SuccessFilled>
-              <p class="font-bold text-blue-500 ml-2">
-                共找到{{ importProgress.total }}条数据,{{
-                  importProgress.progressTotal -
-                  importProgress.errorList.length
-                }}条数据已成功处理
-              </p>
-            </div>
-            <el-button
-              class="w-full mt-10"
-              type="primary"
-              plain
-              @click="
-                visibleLastTimeImport = false;
-                getDepartments();
-              "
-              >我知道了</el-button
-            >
-          </div>
-        </div>
-      </template>
-      <template v-else>
-        <div class="flex justify-between items-center mb-4 space-x-4">
-          <p class="font-bold text-blue-500">
-            共找到{{ importProgress.total }}条数据,{{
-              importProgress.progressTotal - importProgress.errorList.length
-            }}条数据已成功处理<br />
-            <span>
-              {{
-                importProgress.errorList.length
-              }}条数据处理有误,请下载错误数据,修改后再上传本部分错误数据,正确数据无需再上传
-            </span>
-          </p>
-          <el-button
-            type="danger"
-            v-if="importProgress.errorList.length"
-            plain
-            @click="downloadImportErrorData"
-            >下载错误数据</el-button
-          >
-          <!-- <el-button type="warning" link @click="importUploadState = false"
-              >重新上传</el-button
-            > -->
-        </div>
-        <el-table :data="importProgress.errorList">
-          <el-table-column
-            v-for="(col, colIdx) in importDataHeader"
-            :key="colIdx"
-          >
-            <template #header>{{ col }}</template>
-            <template #default="{ $index }">
-              <span>{{ importProgress.errorList[$index][colIdx] }}</span>
-            </template>
-          </el-table-column>
-        </el-table>
-      </template>
-    </el-dialog>
-    <el-dialog v-model="importDialogVisible" title="导入部门信息">
-      <div
-        v-if="!importUploadState"
-        class="p-4 py-10 flex items-center justify-center flex-col"
-      >
-        <p class="my-4 text-gray-600 text-sm">
-          请下载模板文件,按照模板文件数据格式填充数据
-        </p>
-
-        <el-button
-          type="primary"
-          link
-          class="my-6 px-4 py-2 bg-blue-500 text-white rounded-md"
-          download="部门导入模板"
-          :href="`${VITE_APP_OSS}/archives-import-template.xlsx`"
-          tag="a"
-          >一键导入excel模板下载</el-button
-        >
-
-        <el-upload
-          ref="uploadRef"
-          action="#"
-          :show-file-list="false"
-          :limit="2"
-          :http-request="handleUpload"
-        >
-          <!-- :auto-upload="false -->
-          <el-button type="primary"
-            >上传名单文件,请用模板文件制作名单,否则会失败</el-button
-          >
-        </el-upload>
-        <!-- <el-image
-          class="w-full mt-3"
-          :src="errorRemakeImg"
-          :preview-src-list="[errorRemakeImg]"
-        ></el-image> -->
-      </div>
-      <template v-else>
-        <!-- <div
-          v-if="importProgress.total != importProgress.progressTotal"
-          class="flex mb-4"
-        >
-          <span>尚有数据未处理完成...</span>
-          <el-button type="primary" link @click="refreshImportData"
-            >点击刷新</el-button
-          >
-        </div> -->
-        <div
-          class="flex items-center justify-center"
-          v-if="importUploadStatus == 'loading'"
-        >
-          数据上传中,请稍后...
-          <div class="ml-4">
-            <el-button type="primary" plain @click="refreshImportData"
-              >点击刷新</el-button
-            >
-          </div>
-        </div>
-        <div
-          v-else-if="importUploadStatus == 'error'"
-          class="flex justify-center items-center flex-col"
-        >
-          <div>
-            <div class="text-red-500">数据上传失败,请重新上传</div>
-            <el-button
-              class="w-full mt-4"
-              type="primary"
-              plain
-              @click="importUploadState = false"
-              >重新上传</el-button
-            >
-          </div>
-        </div>
-      </template>
-    </el-dialog>
-
-    <el-dialog v-model="personnelManagementVisible" title="人员管理">
-      <div class="flex justify-between items-center">
-        <span
-          >部门名称:<b>
-            {{ personnelManagement.row?.name }}
-            (所属渠道:{{ props.channelName }})</b
-          ></span
-        >
-        <div class="space-x-4">
-          <el-select
-            v-model="appendPersonnelIds"
-            multiple
-            filterable
-            remote
-            :remote-method="searchArchives"
-          >
-            <el-option
-              v-for="(item, index) in searchArchivesList"
-              :key="index"
-              :label="item.name"
-              :value="item.id"
-            ></el-option>
-          </el-select>
-          <el-button
-            type="primary"
-            :disabled="!appendPersonnelIds.length"
-            @click="appendPersonnel"
-            >确定</el-button
-          >
-        </div>
-      </div>
-      <el-divider></el-divider>
-      <el-table :data="personnelManagement.list">
-        <el-table-column label="姓名" prop="name"></el-table-column>
-        <el-table-column
-          label="性别"
-          prop="gender"
-          :formatter="v => (v.gender == 1 ? '男' : '女')"
-        ></el-table-column>
-        <el-table-column label="年龄" prop="birthday">
-          <template #default="{ row }">
-            {{ formatAge(row.birthday) }}
-          </template>
-        </el-table-column>
-        <el-table-column label="档案编号" prop="id"></el-table-column>
-        <el-table-column label="操作">
-          <template #default="{ row }">
-            <el-button type="danger" link @click="removePersonnel(row)"
-              >移除</el-button
-            >
-          </template>
-        </el-table-column>
-      </el-table>
-
-      <el-pagination
-        class="justify-end mt-4"
-        :current-page="personnelManagement.filter.page"
-        :page-size="personnelManagement.filter.pageSize"
-        :total="personnelManagement.total"
-        background
-        layout="total, prev, pager, next, jumper"
-        @current-change="
-          page => {
-            personnelManagement.filter.page = page;
-            getPersonnelList();
-          }
-        "
-      ></el-pagination>
-    </el-dialog>
-  </div>
-</template>
-
-<script setup>
-import SearchArchivesSelect from "@/components/Archives/SearchArchivesSelect.vue";
-import { SuccessFilled } from "@element-plus/icons-vue";
-
-import { onMounted, ref, nextTick } from "vue";
-// 导入ElMessage和ElMessageBox组件
-import {
-  ElMessage,
-  ElMessageBox,
-  ElLoading,
-  progressProps
-} from "element-plus";
-// 导入route、router并定义
-import { useRoute, useRouter } from "vue-router";
-import errorRemake from "@/assets/errorRemake.png";
-import { request, formatAge } from "@/utils";
-import dayjs from "dayjs";
-import { watch } from "vue";
-const { VITE_APP_OSS } = import.meta.env;
-const [route, router] = [useRoute(), useRouter()];
-const props = defineProps({
-  channelId: {
-    default: undefined
-  },
-  channelName: {
-    type: String,
-    default: ""
-  }
-});
-watch(
-  () => props.channelId,
-  (n, o) => {
-    if (n) {
-      try {
-        nextTick(() => {
-          filter.value.channelId = n;
-          onSearch();
-        });
-      } catch (error) {
-        console.log(error);
-      }
-    }
-  },
-  {
-    deep: true,
-    immediate: true
-  }
-);
-const filter = ref({
-  page: 1,
-  pageSize: 10,
-  key: "",
-  type: 2,
-  archivesId: "",
-  channelId: undefined
-});
-const currentArchivesInfo = ref({ departmentId: "" });
-const errorRemakeImg = errorRemake;
-const departments = ref([{}]);
-const treeDepartmentData = ref([]);
-
-const totalDepartments = ref(0);
-
-const mapTree = (org, parentId) => {
-  const haveChildren =
-    Array.isArray(org.subDepartmentList) && org.subDepartmentList.length > 0;
-  return {
-    parentId,
-    departmentId: parentId,
-    ...org,
-    children: haveChildren
-      ? org.subDepartmentList?.map(r => mapTree(r, org.id))
-      : []
-  };
-};
-
-let filterTree = (value, arr) => {
-  let newarr = [];
-  arr.forEach(element => {
-    if (element.name.indexOf(value) > -1) {
-      // 判断条件
-      newarr.push({ ...element, children: element.children });
-    } else {
-      if (element.children && element.children.length > 0) {
-        let result = filterTree(value, element.children);
-        if (result && result.length > 0) {
-          let obj = {
-            ...element,
-            children: result
-          };
-          newarr.push(obj);
-        }
-      }
-    }
-  });
-  return newarr;
-};
-
-const getFlatArr = (arr, key = "children") => {
-  return arr.reduce((val, item) => {
-    let flatArr = [...val, item];
-    // 可以在此处限制各种需要的条件,在展示字段前加空格,——之类的,以及其它情况
-    if (item[key]) {
-      flatArr = [...flatArr, ...getFlatArr(item[key])];
-    }
-    return flatArr;
-  }, []);
-};
-
-const handleChangeArchivesId = (info, options) => {
-  try {
-    currentArchivesInfo.value = options.archivesChannels.filter(
-      v => v.id == props.channelId
-    )[0];
-  } catch (error) {
-    currentArchivesInfo.value = {
-      departmentId: ""
-    };
-  }
-};
-
-const getDepartments = async () => {
-  const { data } = await request.get(
-    `/archivesService/mechanism/department/list`,
-    {
-      params: filter.value
-    }
-  );
-  if (!data.list?.length) {
-    departments.value = [];
-    treeDepartmentData.value = [];
-    return;
-  }
-  let array = [];
-  array = data.list?.map(org => mapTree(org));
-  console.log("array", array);
-
-  departments.value = filterTree(
-    filter.value.type == 1 ? filter.value.key : "",
-    array
-  );
-
-  treeDepartmentData.value = getFlatArr(array);
-
-  totalDepartments.value = data.total;
-};
-
-const hightLight = (keyWord, suggtion) => {
-  // 使用 regexp 构造函数,因为这里要匹配的是一个变量
-  const reg = new RegExp(keyWord, "ig");
-  const newSrt = String(suggtion).replace(reg, function (p) {
-    return `<span style="color: #67C23A">${p}</span>`;
-  });
-  return newSrt;
-};
-
-const onSearch = () => {
-  getDepartments();
-};
-const onReset = () => {
-  filter.value.page = 1;
-  filter.value.pageSize = 10;
-  filter.value.key = "";
-  filter.value.type = 2;
-  filter.value.archivesId = "";
-
-  onSearch();
-};
-
-function handleCurrentChange(page) {
-  filter.value.page = page;
-  getDepartments();
-}
-
-const deleteDepartment = async row => {
-  await ElMessageBox.confirm(`确认要删除这个部门吗?`, "提示");
-  await request.post(`/archivesService/mechanism/department/delete`, {
-    id: row.id
-  });
-  ElMessage.success("删除成功");
-  await getDepartments();
-};
-
-const editDepartmentVisible = ref(false);
-const editDepartment = ref({
-  id: "",
-  name: "",
-  departmentId: undefined,
-  sort: undefined
-});
-const showEditDepartment = department => {
-  if (department) {
-    editDepartment.value = { ...department };
-  } else {
-    editDepartment.value = {
-      id: "",
-      name: "",
-      departmentId: undefined,
-      sort: undefined
-    };
-  }
-  editDepartmentVisible.value = true;
-};
-const saveDepartment = async () => {
-  await request.post(
-    `/archivesService/mechanism/department/${
-      editDepartment.value.id ? "/update/name" : "/create"
-    }`,
-    {
-      ...editDepartment.value,
-      sort: Number(editDepartment.value.sort),
-      channelId: props.channelId
-    }
-  );
-  ElMessage.success("保存成功");
-  editDepartmentVisible.value = false;
-  getDepartments();
-};
-
-const personnelManagementVisible = ref(false);
-
-const personnelManagement = ref({
-  filter: {
-    page: 1,
-    pageSize: 10,
-    needSubArchives: 1,
-    departmentId: 0
-  },
-  row: undefined,
-  list: [],
-  total: 0
-});
-const showPersonnelManagementVisible = row => {
-  personnelManagement.value.row = row;
-  personnelManagement.value.filter.page = 1;
-  personnelManagement.value.filter.departmentId = row.id;
-  personnelManagementVisible.value = true;
-
-  getPersonnelList();
-};
-const getPersonnelList = async () => {
-  const { data } = await request.get(
-    "/archivesService/mechanism/archives/paginate",
-    {
-      params: {
-        ...personnelManagement.value.filter
-      }
-    }
-  );
-  personnelManagement.value.list = data.list;
-  personnelManagement.value.total = data.total;
-};
-const removePersonnel = async row => {
-  await ElMessageBox.confirm(`确认要移除这个人吗?`, "提示");
-  await request.post(`/archivesService/mechanism/department/removeArchives`, {
-    archivesId: row.id,
-    departmentId: personnelManagement.value.row.id
-  });
-  ElMessage.success("删除成功");
-  getDepartments();
-  await getPersonnelList();
-};
-
-const appendPersonnelIds = ref([]);
-const appendPersonnel = async () => {
-  await request.post(`/archivesService/mechanism/department/pushArchives`, {
-    departmentId: personnelManagement.value.row.id,
-    archivesIds: appendPersonnelIds.value
-  });
-  ElMessage.success("添加成功");
-  appendPersonnelIds.value = [];
-  getDepartments();
-  getPersonnelList();
-};
-const searchArchivesList = ref([]);
-const searchArchives = async q => {
-  if (!q) return;
-  const { data } = await request.get(
-    "/archivesService/mechanism/archives/paginate",
-    {
-      params: {
-        page: 1,
-        pageSize: 999,
-        needSubArchives: 1,
-        departmentId: 0,
-        inDepartment: 2,
-        keyword: q,
-        channelId: props.channelId
-      }
-    }
-  );
-  searchArchivesList.value = data.list;
-};
-
-const importDialogVisible = ref(false);
-const importUploadState = ref(false);
-const visibleLastTimeImport = ref(false);
-const importUploadStatus = ref("");
-const importDataHeader = ref([]);
-const importProgress = ref({
-  total: 0,
-  progressTotal: 0,
-  errorList: []
-});
-const handleUpload = async opt => {
-  console.log(opt);
-  importUploadStatus.value = "loading";
-  const loading = ElLoading.service({
-    lock: true,
-    text: "开始上传",
-    background: "rgba(255, 255, 255, 0.7)"
-  });
-  const fd = new FormData();
-  fd.append("file", opt.file);
-  fd.append("channelId", props.channelId);
-
-  try {
-    await request.post("/archivesService/mechanism/archives/import", fd, {
-      headers: {
-        "Content-Type": "multipart/form-data"
-      }
-    });
-    ElMessage.success("上传成功");
-    await getImportProgress();
-    if (importProgress.value?.status > 1) {
-      importDialogVisible.value = false;
-      visibleLastTimeImport.value = true;
-    }
-    // importUploadState.value = true;
-  } catch (e) {
-    console.log("error", e);
-    importUploadState.value = true;
-    importUploadStatus.value = "error";
-  } finally {
-    loading.close();
-  }
-};
-const getImportProgress = async () => {
-  const { data } = await request.get(
-    "/archivesService/mechanism/archives/import/progress"
-  );
-  importProgress.value = {
-    total: data.progress.total,
-    progressTotal: data.progress.progressTotal,
-    errorList: data.progress.errorList.slice(2),
-    status: data.progress.status
-  };
-  importDataHeader.value = data.progress.errorList[1];
-  // importUploadState.value = !!importProgress.value.total;
-};
-
-const refreshImportData = async () => {
-  await getImportProgress();
-  if (importProgress.value?.importProgress > 1) {
-    importDialogVisible.value = false;
-    visibleLastTimeImport.value = true;
-  }
-  ElMessage.success("刷新成功");
-};
-const downloadImportErrorData = async () => {
-  try {
-    const response = await request.post(
-      "/archivesService/mechanism/archives/import/error/download",
-      {},
-      {
-        responseType: "blob"
-      }
-    );
-    console.log(response);
-    const link = document.createElement("a");
-    const blob = new Blob([response], {
-      type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
-    });
-
-    const body = document.body;
-    link.href = window.URL.createObjectURL(blob);
-    link.download = `错误数据-${dayjs(Date.now()).format(
-      "YYYYMMDDHHmmss"
-    )}.xlsx`;
-    body.appendChild(link);
-
-    link.click();
-    body.removeChild(link);
-
-    window.URL.revokeObjectURL(link.href);
-
-    ElMessage.success("下载成功!");
-  } catch (error) {
-    ElMessage.error("下载失败,请重试!");
-    console.error("Export error:", error);
-  }
-};
-// onMounted(onSearch);
-</script>
-
-<style lang="scss"></style>

+ 0 - 239
src/views/archives/expenseRecord.vue

@@ -1,239 +0,0 @@
-<template>
-  <div>
-    <div>
-      <el-card class="mb-4" shadow="never">
-        <div>
-          <el-row>
-            <el-col :span="18">
-              <el-date-picker
-                v-model="state.times"
-                type="daterange"
-                clearable
-                range-separator="至"
-                value-format="YYYY-MM-DD"
-                start-placeholder="开始日期"
-                end-placeholder="结束日期"
-              />
-              <el-select
-                v-model="state.query.cardIds"
-                placeholder="所有会员卡"
-                filterable
-                clearable
-                multiple
-                class="mx-2"
-              >
-                <el-option
-                  v-for="item in memberCardList"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.id"
-                >
-                  <template #default>
-                    <div>
-                      <span style="font-weight: bold">{{ item.name }} </span>
-                      <div class="text-sm text-gray-400" v-if="item.remark">
-                        {{ item.remark }}
-                      </div>
-                    </div>
-                  </template>
-                </el-option>
-              </el-select>
-              <el-cascader
-                v-model="state.query.serviceIds"
-                :options="options"
-                :props="{ multiple: true }"
-                collapse-tags
-                collapse-tags-tooltip
-                clearable
-                placeholder="所有服务项目"
-              />
-              <el-select
-                v-model="state.query.type"
-                placeholder="所有消费类型"
-                filterable
-                class="ml-2"
-              >
-                <el-option label="所有消费类型" :value="0" />
-                <el-option label="消费" :value="1" />
-                <el-option label="退费" :value="2" />
-              </el-select>
-              <el-button class="ml-2" type="primary" @click="onSearch"
-                >筛选</el-button
-              >
-              <el-button type="primary" plain @click="onReset">重置</el-button>
-            </el-col>
-            <el-col :span="6">
-              <div class="flex justify-end text-right">
-                <el-select
-                  v-model="state.query.key"
-                  placeholder="请选择"
-                  style="width: 150px"
-                >
-                  <el-option label="用户" value="user" />
-                  <el-option label="关联的业务单号" value="orderNo" />
-                </el-select>
-                <el-input
-                  v-model="state.query.value"
-                  placeholder="请输入关联业务单号"
-                  v-if="state.query.key == 'orderNo'"
-                  style="width: 195px"
-                />
-                <SearchArchivesSelect
-                  v-model="state.query.value"
-                  v-if="state.query.key == 'user'"
-                  placeholder="输入姓名或者档案号"
-                />
-                <el-button :icon="Search" @click="onSearch">查询</el-button>
-              </div>
-            </el-col>
-          </el-row>
-        </div>
-      </el-card>
-      <el-table :data="state.list" style="width: 100%" border>
-        <el-table-column prop="createdAt" label="业务发生时间" />
-        <el-table-column prop="archiveId" label="用户信息">
-          <template #default="{ row }">
-            <div>
-              <div>{{ row.archiveName }}</div>
-              <div>{{ row.archiveId }}</div>
-            </div>
-          </template>
-        </el-table-column>
-        <el-table-column prop="cardName" label="会员卡名称" />
-        <el-table-column prop="serviceName" label="服务项目名称" />
-        <el-table-column prop="type" label="消费类型">
-          <template #default="{ row }">
-            <div>
-              <div>{{ row?.type == 1 ? "消费" : "退费" }}</div>
-            </div>
-          </template>
-        </el-table-column>
-        <el-table-column prop="quantity" label="业务数量" />
-        <el-table-column
-          prop="cardBalance"
-          label="业务发生后卡内余额"
-          :formatter="v => (v.cardBalance === -1 ? '无限次' : v.cardBalance)"
-        />
-        <el-table-column prop="orderNo" label="关联的业务单号" />
-        <el-table-column prop="remark" label="备注信息" />
-      </el-table>
-      <el-pagination
-        class="mt-4 justify-end"
-        background
-        layout="prev, pager, next"
-        :total="state.total"
-        :page-size="state.pageSize"
-        @current-change="changePage"
-      />
-    </div>
-  </div>
-</template>
-<script setup>
-import { request } from "@/utils";
-import { ref, reactive } from "vue";
-import { Search } from "@element-plus/icons-vue";
-import SearchArchivesSelect from "@/components/Archives/SearchArchivesSelect.vue";
-
-const state = reactive({
-  visible: false,
-  visibleSystemInterest: false,
-  rowData: {},
-  query: {
-    page: 1,
-    pageSize: 10, //
-    cardIds: [],
-    type: 0,
-    serviceIds: [],
-    name: "", // 搜索项目:user: 用户;outTradeNo:第三方订单号
-    key: "user",
-    value: ""
-  },
-  times: [],
-  list: [],
-  total: 0
-});
-
-const memberCardList = ref([]);
-const options = [
-  {
-    value: "sys",
-    label: "系统服务项目",
-    children: [
-      {
-        value: "sys1",
-        label: "报告"
-      },
-      {
-        value: "sys2",
-        label: "添加家人"
-      }
-    ]
-  }
-];
-const getList = () => {
-  let start = undefined;
-  let end = undefined;
-  if (state.times?.length > 0) {
-    start = state.times[0];
-    end = state.times[1];
-  }
-  const serviceIds =
-    state.query.serviceIds.length &&
-    state.query.serviceIds.map(v => {
-      return v[1];
-    });
-  request
-    .get("walletService/mechanism/membershipCard/used/paginate", {
-      params: {
-        ...state.query,
-        cardIds: state.query.cardIds?.join(","),
-        serviceIds: serviceIds ? serviceIds?.join(",") : undefined,
-        start,
-        end
-      }
-    })
-    .then(resp => {
-      state.list = resp.data.list;
-      state.total = resp.data.total;
-    });
-};
-
-const getMemberCardList = () => {
-  request
-    .get("walletService/mechanism/membershipCard/list", {
-      params: { status: 1 }
-    })
-    .then(resp => {
-      memberCardList.value = resp.data;
-    });
-};
-const onSearch = () => {
-  state.query.page = 1;
-  getList();
-};
-const onReset = () => {
-  state.times = [];
-  state.query.cardIds = [];
-  state.query.times = [];
-  state.query.serviceIds = [];
-  state.query.type = 0;
-  state.query.value = "";
-  state.query.key = "";
-  onSearch();
-};
-const changePage = page => {
-  state.query.page = page;
-  getList();
-};
-const initData = () => {
-  getMemberCardList();
-  getList();
-};
-initData();
-</script>
-<style lang="scss">
-.el-select-dropdown__item {
-  overflow: auto;
-  height: auto;
-}
-</style>

+ 0 - 28
src/views/archives/list.vue

@@ -1,28 +0,0 @@
-<template>
-  <div class="page-archives">
-    <!-- {{ url }} -->
-    <Webview :url="url" class="w-full h-full" />
-  </div>
-</template>
-
-<script setup>
-import { computed } from "vue";
-import { getToken } from "@/utils/auth";
-import Webview from "@/components/WebView.vue";
-const { VITE_APP_ARCHIVES } = import.meta.env;
-const url = computed(() => {
-  return `${VITE_APP_ARCHIVES}?accessToken=${encodeURIComponent(
-    getToken().token
-  )}`;
-});
-</script>
-
-<style lang="scss">
-.el-scrollbar__view {
-  height: 100%;
-  .main-content.page-archives {
-    height: 100%;
-    margin: 0;
-  }
-}
-</style>

+ 0 - 298
src/views/archives/memberCard.vue

@@ -1,298 +0,0 @@
-<template>
-  <div>
-    <el-card shadow="never">
-      <div class="flex justify-between">
-        <div>
-          <el-button
-            type="primary"
-            @click="
-              state.visible = true;
-              state.rowData = {};
-            "
-            >+ 新建会员卡</el-button
-          >
-        </div>
-        <div class="text-right flex items-center justify-end w-1/3">
-          <el-select
-            placeholder="全部状态类型"
-            style="width: 280px"
-            v-model="state.query.status"
-          >
-            <el-option label="全部状态类型" :value="-1" />
-            <el-option
-              :label="item.k"
-              :value="item.v"
-              v-for="item in statusList"
-              :key="item.v"
-            />
-          </el-select>
-          <el-input
-            v-model="state.query.name"
-            placeholder="输入会员卡名称关键词搜索"
-            clearable
-            class="w-full ml-2"
-          />
-          <el-button class="ml-2" type="primary" @click="onSearch"
-            >搜索</el-button
-          >
-        </div>
-      </div>
-    </el-card>
-    <el-card shadow="never" class="mt-2">
-      <el-table :data="state.list" style="width: 100%">
-        <el-table-column label="会员卡名称" prop="name" width="" />
-        <el-table-column
-          label="有效期"
-          prop="lifespan"
-          width=""
-          :formatter="v => v.lifespan + '天'"
-        />
-        <el-table-column
-          label="价格"
-          prop="price"
-          :formatter="v => (v.price / 100).toFixed(2) + '元'"
-          width=""
-        />
-        <el-table-column label="包含服务项目" prop="content" width="">
-          <template #default="{ row }">
-            <!-- <div v-html="row.content" /> -->
-            <div>0项</div>
-          </template>
-        </el-table-column>
-        <el-table-column label="上架状态" prop="code" width="">
-          <template #default="{ row }">
-            <span :class="statusList[row.status].class"
-              >已{{ statusList[row.status].k }}</span
-            >
-          </template>
-        </el-table-column>
-        <el-table-column label="是否展示" prop="show" width="">
-          <template #header>
-            <div>
-              是否展示
-              <el-tooltip>
-                <QuestionFilled
-                  class="w-4 h-4 inline align-middle ml-1 cursor-pointer opacity-50"
-                />
-                <template #content>
-                  <div class="text-sm">
-                    参考范围:开启后,该会员卡将展示在小程序端的升级页面内供用户查看。已下架的会员卡无法开启
-                  </div>
-                </template>
-              </el-tooltip>
-            </div>
-          </template>
-          <template #default="{ row }">
-            <el-switch
-              v-model="row.show"
-              :active-value="1"
-              :inactive-value="0"
-              @change="handleChangeShow(row)"
-            />
-          </template>
-        </el-table-column>
-
-        <el-table-column label="展示排序">
-          <template #default="{ row }">
-            <el-input
-              v-model.number="row.sort"
-              type="number"
-              @blur="updateSort(row)"
-              clearable
-            />
-          </template>
-        </el-table-column>
-        <el-table-column label="备注信息">
-          <template #default="{ row }">
-            {{ row.remark }}
-          </template>
-        </el-table-column>
-        <el-table-column label="操作">
-          <template #default="{ row }">
-            <el-space wrap>
-              <el-button type="primary" link @click="handleEdit(row)"
-                >编辑</el-button
-              >
-              <el-button
-                @click="handleChangeStatus(row)"
-                :type="!row.status ? 'primary' : 'danger'"
-                link
-                >{{ !row.status ? "上架" : "下架" }}</el-button
-              >
-              <el-button
-                type="primary"
-                link
-                @click="
-                  () => {
-                    state.visibleSystemInterest = true;
-                    state.rowData = row;
-                  }
-                "
-                >权益配置</el-button
-              >
-              <el-popconfirm
-                title="确定要删除此会员卡吗"
-                @confirm="onDelete(row.id)"
-                width="200"
-              >
-                <template #reference>
-                  <el-button link type="danger" :disabled="row.status == 1"
-                    >删除</el-button
-                  >
-                </template>
-              </el-popconfirm>
-            </el-space>
-          </template>
-        </el-table-column>
-      </el-table>
-
-      <!-- <el-pagination
-        class="mt-4 justify-end"
-        background
-        layout="prev, pager, next"
-        :total="state.total"
-        @current-change="changePage"
-      /> -->
-    </el-card>
-    <DialogEditMemberCard
-      v-model:show="state.visible"
-      :rowData="state.rowData"
-      @success="getList"
-    />
-    <DialogEditMemberSystemInterest
-      v-model:show="state.visibleSystemInterest"
-      :rowData="state.rowData"
-      @success="getList"
-    />
-  </div>
-</template>
-<script setup>
-import { request } from "@/utils";
-import DialogEditMemberCard from "./components/DialogEditMemberCard.vue";
-import DialogEditMemberSystemInterest from "./components/DialogEditMemberSystemInterest.vue";
-
-import { reactive } from "vue";
-
-import { ElMessage, ElMessageBox } from "element-plus";
-import { QuestionFilled } from "@element-plus/icons-vue";
-const state = reactive({
-  visible: false,
-  visibleSystemInterest: false,
-  rowData: {},
-  query: {
-    page: 1,
-    pageSize: 10, //
-    status: -1, // -1:所有状态;0:可用;1:不可用
-    name: undefined
-  },
-  list: [],
-  total: 0
-});
-const statusList = [
-  {
-    k: "下架",
-    v: 0,
-    class: "text-red-600"
-  },
-  {
-    k: "上架",
-    v: 1,
-    class: "text-green-600"
-  }
-];
-const getList = () => {
-  request
-    .get("walletService/mechanism/membershipCard/list", {
-      params: state.query
-    })
-    .then(resp => {
-      state.list = resp.data;
-    });
-};
-const changePage = page => {
-  state.query.page = page;
-  getList();
-};
-
-const updateSort = async row => {
-  await request.post(`walletService/mechanism/membershipCard/sort`, {
-    id: row.id,
-    sort: row.sort
-  });
-
-  ElMessage.success("操作成功");
-  fetchArticle();
-};
-const handleChangeStatus = row => {
-  ElMessageBox.confirm(
-    row.status
-      ? "确定要下架吗?下架后用户将不能再绑定该会员卡,已绑定的用户不受影响"
-      : "确定要上架吗?上架后用户可以绑定该会员卡",
-    "",
-    {
-      distinguishCancelAndClose: true,
-      confirmButtonText: "确定",
-      cancelButtonText: "取消"
-    }
-  )
-    .then(async () => {
-      await request.post("walletService/mechanism/membershipCard/status", {
-        id: row.id,
-        status: !row.status + 0
-      });
-      getList();
-      ElMessage.success("操作成功");
-    })
-    .catch(err => {});
-};
-const handleChangeShow = row => {
-  console.log(row);
-  if (row.status == 0) {
-    row.show = row.show ? 0 : 1;
-
-    return ElMessage.warning("已下架无法开启");
-  }
-  ElMessageBox.confirm(
-    row.show
-      ? "确定要开启展示吗?开启后用户将在小程序端看到该会员卡内容"
-      : "确定要关闭展示吗?关闭后,用户在小程序不能看到该会员卡内容",
-    "",
-    {
-      distinguishCancelAndClose: true,
-      confirmButtonText: "确定",
-      cancelButtonText: "取消"
-    }
-  )
-    .then(async () => {
-      await request.post("walletService/mechanism/membershipCard/show", {
-        id: row.id,
-        show: row.show
-      });
-      getList();
-      ElMessage.success("操作成功");
-    })
-    .catch(err => {
-      row.show = row.show ? 0 : 1;
-    });
-};
-const onDelete = id => {
-  request
-    .post("walletService/mechanism/membershipCard/delete", { id })
-    .then(resp => {
-      ElMessage.success(resp.message);
-      getList();
-    });
-};
-const handleEdit = rowData => {
-  state.rowData = rowData;
-  state.visible = true;
-};
-const onSearch = () => {
-  state.query.page = 1;
-  getList();
-};
-const init = () => {
-  getList();
-};
-init();
-</script>

+ 0 - 499
src/views/archives/serviceProjectSetting.vue

@@ -1,499 +0,0 @@
-<template>
-  <div class="page-channel p-6">
-    <div class="h-full w-full flex">
-      <div class="mr-2">
-        <el-card shadow="never" class="h-full">
-          <template #header>
-            <div class="flex items-center justify-between">
-              <div class="flex items-center">
-                <div>服务类别</div>
-              </div>
-              <el-button
-                type="primary"
-                :icon="Plus"
-                class="ml-2"
-                @click="
-                  editVisible = true;
-                  editForm = {
-                    id: undefined,
-                    name: '',
-                    content: ''
-                  };
-                "
-                >添加服务类别</el-button
-              >
-            </div>
-          </template>
-          <div>
-            <el-table
-              :data="state.list"
-              class="w-full"
-              :show-header="false"
-              max-height="85vh"
-              @row-click="editRow"
-            >
-              <el-table-column prop="name" label="姓名">
-                <template #default="{ row }">
-                  <div
-                    class="p-2 hover:bg-gray-50 cursor-pointer rounded"
-                    :class="{
-                      'bg-gray-10 border-r-4 border-blue-500 color: text-blue-500':
-                        currentValue?.id == row.id
-                    }"
-                  >
-                    <h3>{{ row.name }}</h3>
-                  </div>
-                </template>
-              </el-table-column>
-            </el-table>
-
-            <el-pagination
-              background
-              class="justify-end mt-4"
-              layout="total, prev, pager, next"
-              :page-size="10"
-              :total="state.total"
-              @change="handleCurrentChange"
-            />
-          </div>
-        </el-card>
-      </div>
-      <div class="flex-1 h-full">
-        <div v-if="currentValue?.id" class="h-full flex flex-col bg-white">
-          <div class="p-4 border-b border-solid border-gray-200">
-            <div class="flex items-center justify-between">
-              <div>
-                <h4>{{ currentValue.name }}</h4>
-                <el-text>使用范围:{{ currentValue.content }}</el-text>
-              </div>
-              <div class="ml-8">
-                <el-button type="primary" :icon="Edit" link @click="handleEdit"
-                  >编辑</el-button
-                >
-                <el-popconfirm
-                  title="确定要删除这个机构吗?"
-                  width="300"
-                  @confirm="handleDelete"
-                >
-                  <template #reference>
-                    <el-button type="danger" :icon="Delete" link
-                      >删除</el-button
-                    >
-                  </template>
-                </el-popconfirm>
-              </div>
-            </div>
-          </div>
-          <div class="flex-1 p-4 overflow-y-auto">
-            <div class="flex items-center">
-              <el-button type="primary" @click="showEditCheckItem(null)"
-                >+添加服务项目</el-button
-              >
-            </div>
-            <el-table
-              :data="checkItem.list"
-              border
-              class="mt-4"
-              v-loading="checkItem.loading"
-              element-loading-text="加载中..."
-            >
-              <el-table-column label="检查项目名称" prop="name" />
-              <el-table-column label="检查项目类型">
-                <template #default="{ row }">
-                  {{ ["检验", "检查"][row.type - 1] }}
-                </template>
-              </el-table-column>
-              <el-table-column label="检查内容">
-                <template #default="{ row }">
-                  <div>
-                    {{ row.checkItems.map(v => v.name).join() }}
-                  </div>
-                </template>
-              </el-table-column>
-              <el-table-column label="操作" width="200">
-                <template #default="{ row }">
-                  <el-button
-                    type="primary"
-                    :icon="Edit"
-                    link
-                    @click="showEditCheckItem(row)"
-                    >编辑</el-button
-                  >
-                  <el-popconfirm
-                    title="确定要删除这个检查项目吗?"
-                    width="300"
-                    @confirm="handleDeleteCheckItem(row)"
-                  >
-                    <template #reference>
-                      <el-button type="danger" :icon="Delete" link
-                        >删除</el-button
-                      >
-                    </template>
-                  </el-popconfirm>
-                </template>
-              </el-table-column></el-table
-            >
-
-            <el-pagination
-              background
-              class="justify-end mt-4"
-              layout="total, prev, pager, next"
-              v-model:current-page="checkItem.query.page"
-              :total="checkItem.total"
-              @current-change="
-                p => {
-                  checkItem.query.page = p;
-                  getCheckItemList();
-                }
-              "
-            />
-          </div>
-        </div>
-        <el-card shadow="never" class="h-full" v-else>
-          <div>
-            <el-empty />
-          </div>
-        </el-card>
-      </div>
-    </div>
-
-    <el-dialog title="服务类别设置" v-model="editVisible">
-      <div>
-        <el-form ref="formRef" :model="editForm" label-width="120px">
-          <el-form-item
-            label="类别名称:"
-            prop="name"
-            :rules="[
-              {
-                required: true,
-                message: '请输入类别名称',
-                trigger: 'blur'
-              }
-            ]"
-          >
-            <el-input
-              v-model="editForm.name"
-              placeholder="请输入类别名称"
-              clearable
-            />
-          </el-form-item>
-          <el-form-item label="类别说明:" prop="content">
-            <el-input
-              v-model="editForm.content"
-              type="textarea"
-              :rows="10"
-              placeholder="输入说明信息"
-              clearable
-            />
-          </el-form-item>
-        </el-form>
-      </div>
-      <template #footer>
-        <div>
-          <el-button @click="editVisible = false">取 消</el-button>
-          <el-button type="primary" @click="saveEditTemplate">保 存</el-button>
-        </div>
-      </template>
-    </el-dialog>
-    <el-dialog
-      v-model="editCheckItem.visible"
-      title="服务项目设置"
-      :close-on-press-escape="false"
-      :close-on-click-modal="false"
-      destroy-on-close
-      width="80%"
-    >
-      <el-form ref="formCheckItemRef" :model="editCheckItem.row">
-        <el-form-item
-          label="服务项目名称"
-          prop="name"
-          :rules="[
-            {
-              required: true,
-              message: '请输入服务项目名称',
-              trigger: 'blur'
-            }
-          ]"
-        >
-          <el-input
-            v-model="editCheckItem.row.name"
-            placeholder="请输入服务项目名称"
-            clearable
-          />
-        </el-form-item>
-        <el-form-item
-          label="服务形式"
-          prop="type"
-          :rules="[
-            {
-              required: true,
-              message: '请选择服务形式',
-              trigger: 'blur'
-            }
-          ]"
-        >
-          <el-radio-group v-model="editCheckItem.row.type">
-            <el-radio :label="0">按次服务</el-radio>
-          </el-radio-group>
-        </el-form-item>
-        <el-form-item
-          label="服务方式"
-          prop="mode"
-          :rules="[
-            {
-              required: true,
-              message: '请选择服务方式',
-              trigger: 'blur'
-            }
-          ]"
-        >
-          <el-radio-group v-model="editCheckItem.row.mode">
-            <el-radio :label="0">线上/线下服务</el-radio>
-            <el-radio :label="1">电话服务</el-radio>
-            <el-radio :label="2">综合服务</el-radio>
-            <el-radio :label="3">专家服务</el-radio>
-            <el-radio :label="4">其他</el-radio>
-          </el-radio-group>
-        </el-form-item>
-        <el-form-item label="服务内容描述">
-          <el-input
-            v-model="editCheckItem.row.content"
-            type="textarea"
-            rows="10"
-            placeholder="输入服务项目内容描述"
-          />
-        </el-form-item>
-      </el-form>
-      <template #footer>
-        <el-button @click="editCheckItem.visible = false">取 消</el-button>
-        <el-button type="primary" @click="saveEditCheckItem">保存</el-button>
-      </template>
-    </el-dialog>
-    <el-dialog title="" v-model="state.massAddvisible" width="50%">
-      <div>
-        <el-input
-          type="textarea"
-          v-model="state.content"
-          :rows="18"
-          placeholder="输入检查内容,多个检查内容之间用中文输入法下的分号或顿号区隔"
-        />
-      </div>
-      <template #footer>
-        <el-button @click="state.massAddvisible = false">取 消</el-button>
-        <el-button type="primary" @click="handleMassAddContent"
-          >确 定</el-button
-        >
-      </template>
-    </el-dialog>
-  </div>
-</template>
-<script setup>
-import { ref, reactive } from "vue";
-import { Search, Plus, Edit, Delete } from "@element-plus/icons-vue";
-
-import { request, unique } from "@/utils";
-import { ElMessage } from "element-plus";
-
-const state = reactive({
-  visible: false,
-  list: [],
-  total: 0,
-  rowData: {},
-  content: "",
-  massAddvisible: false
-});
-const query = reactive({
-  title: "",
-  page: 1
-});
-const formCheckItemRef = ref();
-
-const onSearch = () => {
-  query.page = 1;
-  getList();
-};
-const getList = async () => {
-  const { data } = await request.get(
-    "walletService/mechanism/membershipCard/serviceCategory/paginate",
-    { params: query }
-  );
-  state.list = data.list;
-  state.total = data.total;
-  if (query.page == 1 && data.list[0]) {
-    editRow(data.list[0]);
-  }
-};
-const handleCurrentChange = page => {
-  query.page = page;
-  getList();
-};
-const handleDelete = async () => {
-  const { message } = await request.post(
-    `dataService/schemeManage/medicalCheck/hospital/delete`,
-    {
-      id: currentValue.value.id
-    }
-  );
-  ElMessage.success(message);
-  getList();
-};
-getList();
-
-const editRow = row => {
-  currentValue.value = row;
-  checkItem.query.id = row.id;
-  getCheckItemList();
-};
-const editForm = ref({
-  id: "",
-  name: "",
-  content: ""
-});
-const editVisible = ref(false);
-const currentValue = ref({
-  id: ""
-});
-
-const handleEdit = () => {
-  editForm.value = currentValue.value;
-  editVisible.value = true;
-};
-const saveEditTemplate = async () => {
-  const { message } = await request.post(
-    `walletService/mechanism/membershipCard/serviceCategory${
-      editForm.value.id ? "/update" : ""
-    }`,
-    editForm.value
-  );
-  ElMessage.success(message);
-  editVisible.value = false;
-  if (!editForm.value.id) {
-    onSearch();
-  }
-  getList();
-};
-
-const checkItem = reactive({
-  query: {
-    id: "",
-    name: "",
-    page: 1
-  },
-  list: [],
-  total: 0,
-  rowData: {}
-});
-const editCheckItem = reactive({
-  visible: false,
-  systemCheckList: [],
-  row: {
-    id: undefined,
-    name: "",
-    systemCheck: "",
-    type: 1,
-    checkItems: []
-  }
-});
-
-const getCheckItemList = async () => {
-  const { data } = await request.get(
-    "walletService/mechanism/membershipCard/serviceCategory",
-    { params: checkItem.query }
-  );
-  checkItem.list = data.list || [];
-  checkItem.total = data.total;
-};
-const showEditCheckItem = async row => {
-  if (row) {
-    editCheckItem.row = row;
-  } else {
-    editCheckItem.row = {
-      id: undefined,
-      name: "",
-      type: 0,
-      mode: 0,
-      content: ""
-    };
-  }
-  editCheckItem.visible = true;
-};
-const saveEditCheckItem = async () => {
-  formCheckItemRef.value.validate(async valid => {
-    if (!valid) return;
-    // return
-    const { message } = await request.post(
-      `walletService//mechanism/membershipCard/serviceItem${
-        editCheckItem.row.id ? "/update" : ""
-      }`,
-      {
-        categoryId: currentValue.value.id,
-        ...editCheckItem.row,
-        id: checkItem.query.id
-      }
-    );
-    ElMessage.success(message);
-    editCheckItem.visible = false;
-    getCheckItemList();
-  });
-};
-const handleDeleteCheckItem = async row => {
-  const { message } = await request.post(
-    `dataService/schemeManage/medicalCheck/item/delete`,
-    {
-      id: row.id,
-      id: checkItem.query.id
-    }
-  );
-  ElMessage.success(message);
-  getCheckItemList();
-};
-
-const handleMassAddContent = () => {
-  try {
-    const contentArray = state.content
-      .replaceAll(";", "、")
-      .split("、")
-      .filter(v => v);
-
-    const array = [];
-    contentArray.map(v => {
-      array.push({
-        name: v,
-        unit: "",
-        scope: "",
-        sort: "",
-        node: "",
-        nodes: [],
-        matchProject: [],
-        indicators: []
-      });
-    });
-    // 去重
-    editCheckItem.row.checkItems = unique(
-      [...editCheckItem.row.checkItems, ...array],
-      "name"
-    );
-  } catch (error) {
-    ElMessage.error(error);
-  } finally {
-    state.massAddvisible = false;
-  }
-};
-</script>
-<style lang="scss">
-.el-scrollbar__view {
-  height: 100%;
-  .main-content.page-channel {
-    height: 100%;
-    margin: 0;
-  }
-}
-::v-deep {
-  .el-card__header {
-    height: 74px;
-  }
-  .el-table .el-table__body tr:hover > td {
-    background-color: transparent;
-  }
-}
-</style>

+ 0 - 74
src/views/archives/serviceSetting.vue

@@ -1,74 +0,0 @@
-<template>
-  <div>
-    <el-card shadow="never">
-      <template #header>
-        <div class="flex justify-between">
-          <h3>注册赠送会员卡设置</h3>
-          <el-button type="primary" plain @click="onSaveMemberCard"
-            >保 存</el-button
-          >
-        </div>
-      </template>
-      <div>
-        <span class="text-base">用户注册后自动绑定会员卡:</span>
-        <el-select
-          v-model="state.cardId"
-          placeholder="请选择"
-          filterable
-          clearable
-          class="mr-4"
-          style="width: 500px"
-        >
-          <el-option
-            v-for="item in memberCardList"
-            :key="item.id"
-            :label="item.name"
-            :value="item.id"
-          />
-        </el-select>
-        <div class="text-sm text-gray-400 mt-4">
-          通过后台创建用户或者用户端注册后,可自定绑定该设置的会员卡。可随时取消。
-        </div>
-      </div>
-    </el-card>
-  </div>
-</template>
-<script setup>
-import { request } from "@/utils";
-import { ElMessage } from "element-plus";
-import { reactive, ref } from "vue";
-
-const state = reactive({
-  cardId: undefined
-});
-const memberCardList = ref([]);
-const getMemberCardList = () => {
-  request
-    .get("walletService/mechanism/membershipCard/list", {
-      params: { status: 1 }
-    })
-    .then(resp => {
-      memberCardList.value = resp.data;
-    });
-};
-const onSaveMemberCard = () => {
-  request
-    .post("walletService/mechanism/membershipCard/register", {
-      cardId: !state.cardId ? 0 : state.cardId
-    })
-    .then(resp => {
-      ElMessage.success(resp.message);
-      getRegisterMemberInfo();
-    });
-};
-const getRegisterMemberInfo = () => {
-  request.get("walletService/mechanism/membershipCard/register").then(resp => {
-    state.cardId = !resp.data.cardId ? "" : resp.data.cardId;
-  });
-};
-const initData = () => {
-  getMemberCardList();
-  getRegisterMemberInfo();
-};
-initData();
-</script>

+ 0 - 51
src/views/archives/setting.vue

@@ -1,51 +0,0 @@
-<template>
-  <div>
-    <div class="text-lg mb-4">档案模板设置:</div>
-    <div>
-      <el-select v-model="detail.formTemplateId">
-        <el-option v-for="(item, index) in templateList" :key="index" :label="item.name" :value="item.id"></el-option>
-      </el-select>
-      <el-button type="primary" class="ml-4" @click="saveTemplateSetting">保存</el-button>
-    </div>
-  </div>
-</template>
-
-<script setup>
-import { ref } from "vue";
-import { request } from "@/utils";
-import { ElMessage } from "element-plus";
-
-const detail = ref({
-  createdAt: "2",
-  formTemplateId: "",
-  id: "",
-  mechanism: null,
-  permissions: "",
-  status: 0,
-  updatedAt: ""
-});
-const templateList = ref([])
-const getTemplates = async () => {
-  const { data } = await request.get(`/archivesService/mechanism/formTemplate/list`)
-  templateList.value = data.list
-};
-getTemplates()
-const getDetail = async () => {
-  const { data } = await request.get(
-    "/archivesService/mechanism/mechanismConfig/detail"
-  );
-  detail.value = data.detail
-};
-getDetail();
-const saveTemplateSetting = async () => {
-  await request.post(
-    "/archivesService/mechanism/mechanismConfig/setFormTemplate", {
-      formTemplateId: detail.value.formTemplateId
-    }
-  );
-  ElMessage.success('操作成功')
-  getDetail()
-};
-</script>
-
-<style lang="scss" scoped></style>

+ 0 - 315
src/views/content/article.vue

@@ -1,315 +0,0 @@
-<template>
-  <el-row>
-    <el-col :span="24">
-      <el-row class="mb-4">
-        <el-col :span="12">
-          <el-button type="primary" @click="router.push({
-            path: '/content/editArticle'
-          })">新增</el-button>
-          <el-button @click="handleManageCategories">版块设置</el-button>
-        </el-col>
-        <el-col :span="12" class="text-right">
-          <div class="w-80 inline-flex item-center">
-            <el-input
-              v-model="query.title"
-              class="flex-1"
-              placeholder="请输入标题"
-              @keyup.enter.native="handleSearch"
-            />
-            <el-button type="primary" class="ml-4" @click="handleSearch"
-              >搜索</el-button
-            >
-          </div>
-        </el-col>
-      </el-row>
-      <el-table :data="list" class="my-2">
-        <el-table-column prop="title" label="标题"></el-table-column>
-        <el-table-column label="所属版块">
-          <template #default="{ row }">
-            {{  row.modules ? row.modules.map(v => v.name).join() : row.modules }}
-          </template>
-        </el-table-column>
-        <el-table-column prop="createdAt" label="创建时间"></el-table-column>
-        <el-table-column prop="sort" label="排序(数字越大越排在前)">
-          <template #default="{ row }">
-            <el-input
-              v-model.number="row.sort"
-              type="number"
-              @blur="updateSort(row)"
-            ></el-input>
-          </template>
-        </el-table-column>
-        <el-table-column label="操作">
-          <template #default="{ row }">
-            <el-button type="primary" link @click="router.push({
-              path: '/content/editArticle',
-              query: {
-                id: row.id
-              }
-            })"
-              >编辑</el-button
-            >
-            <el-button type="danger" link @click="handleDelete(row)"
-              >删除</el-button
-            >
-          </template>
-        </el-table-column>
-      </el-table>
-      <el-pagination
-        class="mt-4 justify-end"
-        :page-sizes="[10, 20, 50, 100]"
-        :page-size="query.pageSize"
-        :current-page="query.page"
-        :total="total"
-        background
-        layout="total, sizes, prev, pager, next, jumper"
-        @size-change="handleSizeChange"
-        @current-change="handleCurrentChange"
-      />
-    </el-col>
-    <el-dialog title="版块设置" v-model="category.visible" width="90%">
-      <el-form
-        v-model="category.form"
-        label-position="left"
-        class="tag-category-form"
-      >
-        <el-form-item label="新增版块">
-          <div class="flex items-center">
-            <el-input
-              v-model.trim="category.form.name"
-              class="flex-1 mr-4"
-              placeholder="版块名称(限制30字符)"
-              maxlength="30"
-              clearable
-            ></el-input>
-            <el-button
-              type="primary"
-              :disabled="!category.form.name"
-              @click="handleCreateCategory"
-              >确定添加</el-button
-            >
-          </div>
-        </el-form-item>
-      </el-form>
-
-      <el-divider></el-divider>
-      <!--
-      <div class="flex justify-end">
-        <div class="w-80 flex items-center">
-          <el-input
-            v-model.trim="category.query.key"
-            class="mr-4"
-            placeholder="标签类别名称或编号"
-            clearable
-            @keyup.enter="handleCategorySearch"
-          ></el-input>
-          <el-button type="primary" @click="handleCategorySearch"
-            >搜索</el-button
-          >
-        </div>
-      </div> -->
-
-      <!-- 第四行:标签类别列表 -->
-      <el-table :data="category.list" class="w-100 mt-5">
-        <el-table-column prop="sn" label="版块编号"></el-table-column>
-        <el-table-column prop="name" label="版块名称">
-          <template #default="{ row }">
-            <el-input
-              v-model="row.name"
-              placeholder="请输入版块名称"
-              @blur="handleEditCategory(row)"
-            ></el-input>
-          </template>
-        </el-table-column>
-        <el-table-column prop="remark" label="用途备注">
-          <template #default="{ row }">
-            <el-input
-              v-model="row.purpose"
-              placeholder="请输入版用途备注"
-              @blur="handleEditCategory(row)"
-            ></el-input>
-          </template>
-        </el-table-column>
-        <el-table-column label="操作">
-          <template #default="{ row }">
-            <el-button type="danger" @click="handleDeleteCategory(row.id)"
-              >删除</el-button
-            >
-          </template>
-        </el-table-column>
-      </el-table>
-
-      <!-- 第五行:分页 -->
-      <el-pagination
-        class="justify-end mt-4"
-        :current-page="category.query.page"
-        :page-size="category.query.pageSize"
-        :total="category.total"
-        background
-        layout="total, prev, pager, next, jumper"
-        @current-change="handleCategoryPageChange"
-      ></el-pagination>
-    </el-dialog>
-  </el-row>
-</template>
-
-<script setup>
-import { ref } from "vue";
-import { request } from "@/utils/http";
-import { useRoute, useRouter } from "vue-router";
-import { ElMessage, ElMessageBox } from "element-plus";
-
-const [route, router] = [useRoute(), useRouter()];
-const list = ref([]);
-const query = ref({
-  title: "",
-  page: 1,
-  pageSize: 10
-});
-const total = ref(0);
-
-const category = ref({
-  visible: false,
-  form: {
-    id: 0,
-    sn: "",
-    name: ""
-  },
-  query: {
-    name: "",
-    page: 1,
-    pageSize: 10
-  },
-  list: [],
-  total: 0
-});
-
-const handleCreateCategory = async () => {
-  await request.post(
-    "/articleService/module",
-    {
-      name: category.value.form.name
-    }
-  );
-  ElMessage.success("添加成功");
-  category.value.form = {
-    id: 0,
-    sn: "",
-    name: ""
-  };
-  fetchCategories();
-};
-
-const handleCategorySearch = () => {
-  category.value.query.page = 1;
-  fetchCategories();
-};
-
-const handleCategoryPageChange = page => {
-  category.value.query.page = page;
-  fetchCategories();
-};
-
-const handleEditCategory = async row => {
-  if (row.name == row.originName && row.purpose == row.originPurpose) return;
-  await request.post("/articleService/module/update", {
-    id: row.id,
-    name: row.name,
-    purpose: row.purpose
-  });
-  ElMessage.success("修改成功");
-  fetchCategories();
-};
-
-const handleDeleteCategory = async id => {
-  ElMessageBox.confirm("确认删除该标签类别吗?", "提示").then(async () => {
-    await request.post("/articleService/module/delete", { id });
-    ElMessage.success("删除成功");
-    fetchCategories();
-  });
-};
-
-const fetchCategories = async () => {
-  const { data } = await request.get("/articleService/module/paginate", {
-    params: category.value.query
-  });
-  category.value.list = data.list.map(item => {
-    item.originName = item.name;
-    item.originPurpose = item.purpose;
-    return item;
-  });
-  category.value.total = data.total;
-};
-
-const handleManageCategories = () => {
-  fetchCategories();
-  category.value.visible = true;
-};
-
-const handleSearch = () => {
-  query.value.page = 1;
-  fetchArticle();
-};
-
-const tagEditRef = ref();
-const handleAddTag = () => {
-  tagEditRef.value.openDialog({
-    id: 0
-  });
-};
-
-const handleEditTag = row => {
-  tagEditRef.value.openDialog({ ...row });
-};
-
-const updateSort = async row => {
-  await request.post(`/articleService/article/update`, {
-    ...row,
-    moduleIds: (row.modules || []).map(v => v.id)
-  })
-
-  ElMessage.success("操作成功");
-  fetchArticle();
-};
-
-const handleEditTagSave = () => {
-  fetchArticle();
-};
-
-const handleSizeChange = size => {
-  query.value.pageSize = size;
-  fetchArticle();
-};
-
-const handleCurrentChange = page => {
-  query.value.page = page;
-  fetchArticle();
-};
-
-const handleDelete = async row => {
-  ElMessageBox.confirm("是否确定删除?", "提示").then(async () => {
-    await request.post(`/articleService/article/delete`, {
-      id: row.id
-    });
-    ElMessage.success("操作成功");
-    fetchArticle();
-  });
-};
-
-const fetchArticle = async () => {
-  const { data } = await request.get("/articleService/article/paginate", {
-    params: { ...query.value }
-  });
-  list.value = data.list.map(v => ({
-    ...v,
-    originSort: v.sort
-  }));
-  total.value = data.total;
-};
-
-fetchArticle();
-</script>
-
-<style scoped>
-/* 样式代码 */
-</style>

+ 0 - 188
src/views/content/components/UpdateCategory.vue

@@ -1,188 +0,0 @@
-<template>
-  <div>
-    <el-dialog title="类别管理" v-model="dialogVisible">
-      <div>
-        <el-form ref="formDataRef" :model="formData" label-width="120px">
-          <el-form-item
-            label="类别名称"
-            prop="name"
-            :rules="[{ required: true, message: '请输入类别名称' }]"
-          >
-            <el-input
-              v-model="formData.name"
-              placeholder="请输入类别名称"
-              clearable
-            ></el-input>
-          </el-form-item>
-          <el-form-item
-            label="封面"
-            required
-            prop="icon"
-            :rules="[{ validator: validateIcon, trigger: 'blur' }]"
-          >
-            <UploadOnlyImage
-              v-model:url="formData.icon"
-              :key="coverKey"
-              type="image"
-            />
-          </el-form-item>
-          <el-form-item
-            label="关联知识库板块"
-            prop="moduleId"
-            :rules="[{ required: true, message: '请选择板块' }]"
-          >
-            <el-select v-model="formData.moduleId" placeholder="请选择板块">
-              <el-option
-                :label="item.name"
-                :value="item.id"
-                v-for="item in articleList"
-                :key="item.sn"
-              ></el-option>
-            </el-select>
-          </el-form-item>
-        </el-form>
-      </div>
-      <template #footer>
-        <div>
-          <el-button @click="dialogVisible = false">取 消</el-button>
-          <el-button type="primary" @click="handleSubmit">确 定</el-button>
-        </div>
-      </template>
-    </el-dialog>
-  </div>
-</template>
-<script lang="ts" setup>
-import { ref, computed, defineProps, defineEmits, watch, reactive } from "vue";
-import UploadOnlyImage from "@/components/UploadOnlyImage.vue";
-import type { UploadProps } from "element-plus";
-import { Plus } from "@element-plus/icons-vue";
-import { request } from "@/utils";
-import { ElMessage } from "element-plus";
-import { nextTick } from "process";
-const props = defineProps({
-  show: {
-    type: Boolean,
-    default: false
-  },
-  rowData: {
-    type: Object,
-    default: () => {}
-  }
-});
-const formData = ref({
-  name: "",
-  icon: [],
-  moduleId: ""
-});
-const validateIcon = (rule: any, value: any, callback: any) => {
-  console.log(value);
-
-  if (!formData.value.icon.length) {
-    callback(new Error("请上传封面"));
-  } else {
-    callback();
-  }
-};
-const formDataRef = ref();
-const articleList = ref([]);
-const coverKey = ref(Date.now());
-
-const emits = defineEmits(["update:show", "success"]);
-const dialogVisible = computed({
-  get() {
-    return props.show;
-  },
-
-  set(n) {
-    emits("update:show", n);
-  }
-});
-
-watch(
-  () => dialogVisible.value,
-  n => {
-    if (n) {
-      initData();
-      if (props.rowData.id) {
-        console.log(props.rowData);
-        let { icon } = props.rowData;
-        formData.value = {
-          ...props.rowData,
-          icon: icon
-            ? [
-                {
-                  name: "food.jpeg",
-                  url: icon
-                }
-              ]
-            : []
-        };
-      }
-      console.log(formData.value);
-    } else {
-      nextTick(onReset);
-    }
-  }
-);
-const getArticleList = () => {
-  request
-    .get("articleService/module/paginate", {
-      params: {
-        page: 1,
-        pageSize: 1000
-      }
-    })
-    .then(resp => {
-      articleList.value = resp.data.list;
-    });
-};
-
-const onReset = () => {
-  formDataRef.value.resetFields();
-  formData.value.icon = [];
-  formData.value.name = "";
-  formData.value.moduleId = "";
-
-  coverKey.value++;
-};
-const handleSubmit = () => {
-  formDataRef.value.validate((valid, fields) => {
-    if (!valid) return;
-    let params = {
-      id: formData.value?.id,
-      name: formData.value?.name,
-      moduleId: formData.value?.moduleId || undefined,
-      icon: formData.value?.icon[0].url
-    };
-    let api = props.rowData.id
-      ? "articleService/policy/category/update"
-      : "articleService/policy/category";
-    request.post(api, params).then(resp => {
-      ElMessage.success(resp.message);
-      dialogVisible.value = false;
-      emits("success");
-    });
-  });
-};
-// const beforeAvatarUpload: UploadProps["beforeUpload"] = rawFile => {
-//   if (!["image/png", "image/jpeg"].includes(rawFile.type)) {
-//     ElMessage.error("Avatar picture must be JPG format!");
-//     return false;
-//   } else if (rawFile.size / 1024 / 1024 > 2) {
-//     ElMessage.error("Avatar picture size can not exceed 2MB!");
-//     return false;
-//   }
-//   return true;
-// };
-
-// const simpleImgHttpUpload = options => {
-//   console.log("options", options);
-//   uploadToOSS(options.file, options.file.name).then(resp => {
-//     state.ruleForm.url = resp;
-//   });
-// };
-const initData = () => {
-  getArticleList();
-};
-</script>
-<style lang="scss" scoped></style>

+ 0 - 321
src/views/content/contentConfig.vue

@@ -1,321 +0,0 @@
-<template>
-  <div>
-    <el-row>
-      <el-card shadow="never" class="w-full">
-        <template #header>
-          <h3>小程序政策内容</h3>
-        </template>
-        <div>
-          <el-button
-            plain
-            @click="
-              () => {
-                state.policyContent.visible = true;
-                state.policyContent.rowData = {};
-              }
-            "
-            >新建政策类别</el-button
-          >
-          <div class="pt-4">
-            <el-table :data="state.policyContent.tableData" style="width: 100%">
-              <el-table-column prop="name" label="类别名称"> </el-table-column>
-              <el-table-column prop="name" label="是否启用">
-                <template #default="{ row }">
-                  <el-switch
-                    v-model="row.status"
-                    :active-value="1"
-                    :inactive-value="0"
-                    @change="onChangeStatus(row)"
-                  >
-                  </el-switch>
-                </template>
-              </el-table-column>
-              <el-table-column prop="sort" label="排序(数字越大越排在前)">
-                <template #default="{ row }">
-                  <el-input
-                    v-model.number="row.sort"
-                    type="number"
-                    @blur="updateSort(row)"
-                  ></el-input>
-                </template>
-              </el-table-column>
-              <el-table-column prop="" label="操作">
-                <template #default="{ row }">
-                  <el-button type="primary" link @click="handleEdit(row)"
-                    >编辑</el-button
-                  >
-                </template>
-              </el-table-column>
-            </el-table>
-            <el-pagination
-              class="mt-4 justify-end"
-              background
-              layout="prev, pager, next"
-              :total="state.pagination.total"
-              @current-change="changePage"
-            />
-          </div>
-        </div>
-      </el-card>
-      <el-card class="mt-4 w-full" shadow="never">
-        <template #header>
-          <h3>小程序健康知识管理</h3>
-        </template>
-        <div>
-          <el-form-item label="" prop="">
-            <el-select
-              v-model="moduleList[0].moduleId"
-              placeholder="请选择板块"
-            >
-              <el-option
-                :label="item.name"
-                :value="item.id"
-                v-for="item in articleList"
-                :key="item.sn"
-              ></el-option>
-            </el-select>
-            <el-button
-              class="ml-2"
-              plain
-              type="primary"
-              @click="handleSaveModuleId(1)"
-              >保 存</el-button
-            >
-          </el-form-item>
-        </div>
-      </el-card>
-      <el-card class="mt-4 w-full" shadow="never">
-        <template #header>
-          <h3>大屏健康互动管理</h3>
-        </template>
-        <div>
-          <el-form label-position="left">
-            <el-form-item label="医疗小常识" label-width="100">
-              <el-select
-                v-model="moduleList[1].moduleId"
-                placeholder="请选择知识库板块"
-              >
-                <el-option
-                  :label="item.name"
-                  :value="item.id"
-                  v-for="item in articleList"
-                  :key="item.sn"
-                ></el-option>
-              </el-select>
-              <el-button
-                class="ml-2"
-                plain
-                type="primary"
-                @click="handleSaveModuleId(2)"
-                >保 存</el-button
-              >
-            </el-form-item>
-
-            <el-form-item label="医康养工作" label-width="100">
-              <el-select
-                v-model="moduleList[2].moduleId"
-                placeholder="请选择知识库板块"
-              >
-                <el-option
-                  :label="item.name"
-                  :value="item.id"
-                  v-for="item in articleList"
-                  :key="item.sn"
-                ></el-option>
-              </el-select>
-              <el-button
-                class="ml-2"
-                plain
-                type="primary"
-                @click="handleSaveModuleId(3)"
-                >保 存</el-button
-              >
-            </el-form-item>
-
-            <el-form-item label="健康互动" label-width="100">
-              <el-select
-                v-model="moduleList[3].moduleId"
-                placeholder="请选择知识库板块"
-              >
-                <el-option
-                  :label="item.name"
-                  :value="item.id"
-                  v-for="item in articleList"
-                  :key="item.sn"
-                ></el-option>
-              </el-select>
-              <el-button
-                class="ml-2"
-                plain
-                type="primary"
-                @click="handleSaveModuleId(4)"
-                >保 存</el-button
-              >
-            </el-form-item>
-          </el-form>
-        </div>
-      </el-card>
-    </el-row>
-
-    <ComponentUpdateCategory
-      v-model:show="state.policyContent.visible"
-      :rowData="state.policyContent.rowData"
-      @success="changePage(1)"
-    ></ComponentUpdateCategory>
-  </div>
-</template>
-<script lang="ts" setup>
-import { request } from "@/utils";
-import { log } from "console";
-import { resolve } from "dns";
-import { ElMessage, ElMessageBox } from "element-plus";
-import { reactive, ref } from "vue";
-import ComponentUpdateCategory from "./components/UpdateCategory.vue";
-import { useUserStoreHook } from "@/store/modules/user";
-
-const state = reactive({
-  policyContent: {
-    tableData: [],
-    visible: false,
-    rowData: {}
-  },
-  query: {
-    page: 1,
-    pageSize: 15
-  },
-  pagination: {
-    total: 0
-  },
-  moduleId: null
-});
-const moduleList = ref([
-  {
-    moduleId: null,
-    key: "小程序健康知识",
-    type: 1
-  },
-  {
-    moduleId: null,
-    key: "医疗小常识",
-    type: 2
-  },
-  {
-    moduleId: null,
-    key: "医康养工作",
-    type: 3
-  },
-  {
-    moduleId: null,
-    key: "医康养工作",
-    type: 4
-  }
-]);
-const articleList = ref([]);
-const mechanismId = useUserStoreHook()?.profile.id;
-
-const getPolicyContentTable = () => {
-  request.get("/articleService/policy/category/paginate", {}).then(resp => {
-    state.policyContent.tableData = resp?.data.list;
-    state.pagination.total = resp.data.total;
-  });
-};
-
-const getArticleList = () => {
-  // articleService/module/paginate
-  return new Promise(resolve => {
-    request
-      .get("articleService/module/paginate", {
-        params: {
-          page: 1,
-          pageSize: 1000
-        }
-      })
-      .then(resp => {
-        articleList.value = resp.data.list;
-        resolve();
-      });
-  });
-};
-const onChangeStatus = row => {
-  ElMessageBox.confirm(
-    row.status ? "确定要启用此类别吗?" : "确定要关闭此类别吗?",
-    "",
-    {
-      distinguishCancelAndClose: true,
-      confirmButtonText: "确定",
-      cancelButtonText: "取消"
-    }
-  )
-    .then(async () => {
-      await request.post("/articleService/policy/category/status", row);
-      ElMessage.success("操作成功");
-      getPolicyContentTable();
-    })
-    .catch(err => {
-      row.status = row.status ? 0 : 1;
-    });
-};
-const handleEdit = rowData => {
-  state.policyContent.rowData = rowData;
-  state.policyContent.visible = true;
-};
-const initData = async () => {
-  getPolicyContentTable();
-  await getArticleList();
-  Promise.all([
-    getModuleList(1),
-    getModuleList(2),
-    getModuleList(3),
-    getModuleList(4)
-  ]).then(resp => {
-    resp.map((v, i) => {
-      moduleList.value[i] = { ...moduleList.value[i], ...v[0] };
-    });
-  });
-};
-const changePage = page => {
-  state.query.page = page;
-  getPolicyContentTable();
-};
-const handleSaveModuleId = (type: number) => {
-  if (!moduleList.value[type - 1].moduleId) {
-    return ElMessage.error("请选择板块");
-  }
-  request
-    .post("articleService/policy/domain/module", {
-      type: type,
-      moduleId: moduleList.value[type - 1].moduleId
-    })
-    .then(resp => {
-      ElMessage.success(resp.message);
-      getModuleList(type);
-    });
-};
-
-const updateSort = async row => {
-  let resp = await request.post("/articleService/policy/category/sort", {
-    id: row.id,
-    sort: row.sort
-  });
-  ElMessage.success(resp.message);
-  getPolicyContentTable();
-};
-
-const getModuleList = typeIds => {
-  return new Promise(resolve => {
-    request
-      .get("articleService/open/domain/list", {
-        params: {
-          mechanismId: mechanismId,
-          typeIds: typeIds
-        },
-        headers: { token: "debug" }
-      })
-      .then(resp => {
-        resolve(resp.data);
-      });
-  });
-};
-initData();
-</script>
-<style scoped lang="scss"></style>

+ 0 - 137
src/views/content/editArticle.vue

@@ -1,137 +0,0 @@
-<template>
-  <div>
-    <el-form label-position="top">
-      <el-form-item label="标题" required>
-        <el-input
-          v-model="form.title"
-          class="w-1/2 min-h-24"
-          placeholder="请输入内容标题"
-        ></el-input>
-      </el-form-item>
-      <el-form-item label="所属版块"  required>
-        <el-select v-model="form.moduleIds" multiple filterable>
-          <el-option v-for="(item, index) in moduleList" :key="index" :label="item.name" :value="item.id"></el-option>
-        </el-select>
-      </el-form-item>
-      <el-form-item label="封面"  required>
-        <UploadImage v-model:url="form.cover" :key="coverKey" type="image" />
-      </el-form-item>
-      <el-form-item label="内容" required>
-        <div class="border border-solid border-gray-200">
-          <Toolbar
-            :editor="editorRef"
-            :defaultConfig="{
-              excludeKeys: [
-                'uploadVideo'
-              ]
-            }"
-            mode="default"
-            class="border-b border-solid border-gray-200"
-          />
-          <div class="h-96">
-            <Editor
-              v-model="form.content"
-              :defaultConfig="editorConfig"
-              mode="default"
-              @onCreated="editorCreated"
-            />
-          </div>
-        </div>
-      </el-form-item>
-      <el-form-item>
-        <el-button @click="router.back">返回</el-button>
-        <el-button type="primary" @click="saveArticle">保存</el-button>
-      </el-form-item>
-    </el-form>
-  </div>
-</template>
-
-<script setup>
-import { shallowRef, ref, reactive, onMounted, nextTick } from "vue";
-import { useRoute, useRouter } from "vue-router";
-import { Editor, Toolbar } from "@wangeditor/editor-for-vue";
-import { DomEditor } from "@wangeditor/editor";
-import "@wangeditor/editor/dist/css/style.css"; // 引入 css
-import { request, uploadToOSS } from "@/utils";
-import UploadImage from '@/components/UploadImage.vue';
-import { ElMessage, ElMessageBox } from "element-plus";
-
-const [route, router] = [useRoute(), useRouter()];
-
-const editorRef = shallowRef();
-const editorCreated = editor => {
-  editorRef.value = editor;
-  // nextTick(() => {
-  //   const toolbar = DomEditor.getToolbar(editor)
-  //   console.log(DomEditor, editor, toolbar);
-  //   const curToolbarConfig = toolbar.getConfig()
-  //   console.log( curToolbarConfig.toolbarKeys )
-  // })
-};
-defineOptions({
-  name: ""
-});
-const form = ref({
-  title: "",
-  moduleIds: [],
-  content: "",
-  sort: 0,
-  cover: [],
-  id: undefined
-});
-const editorConfig = {
-  placeholder: '请输入内容....',
-  MENU_CONF: {
-    uploadImage: {
-      // 自定义上传
-      async customUpload(file, insertFn) {
-        console.log(file);
-        // file 即选中的文件
-        const url = await uploadToOSS(file, file.name);
-        // 最后插入图片
-        insertFn(url, 'image');
-      }
-    }
-  }
-};
-const moduleList = ref([])
-const fetchModules = async () => {
-  const { data } = await request.get("/articleService/module/paginate", {
-    params: {
-      page: 1,
-      pageSize: 9999
-    }
-  });
-  moduleList.value = data.list
-};
-const coverKey = ref(Date.now())
-const getDetail = async () => {
-  const { data } = await request.get(`/articleService/article`, {
-    params: {
-      id: route.query.id
-    }
-  })
-  form.value = {
-    ...form.value,
-    ...data,
-    cover: Array.isArray(data.cover) ? data.cover.map((v, k) => ({ name: `cover${k}.${v.split('.').at(-1)}`, url: v })) : [],
-    moduleIds: (data.modules || []).map(v => v.id)
-  }
-  coverKey.value++
-
-}
-const saveArticle = async () => {
-  if (!form.value.title || !form.value.content || !form.value.moduleIds.length) return ElMessage.error('请填选必填项')
-  const req = { ...form.value }
-  req.cover = req.cover.map(v => v.url)
-  await request.post(form.value.id ? `/articleService/article/update` : `/articleService/article`, req)
-  ElMessage.success('操作成功')
-  route.query.id && getDetail()
-}
-onMounted(() => {
-  fetchModules()
-  route.query.id && getDetail()
-})
-</script>
-
-<style lang="scss" scoped></style>

+ 0 - 502
src/views/dataCenter/checkData.vue

@@ -1,502 +0,0 @@
-<template>
-  <div class="page-check-data h-full">
-    <div class="flex items-center h-12 py-2 px-4 bg-white">
-      <div class="flex-1 space-x-4">
-        <el-tag class="cursor-copy" size="large" v-copy:click="route.query.sn">
-          <span class="align-middle select-none"
-            >数据批次号:{{ route.query.sn }}</span
-          >
-          <CopyDocument class="inline-block align-middle ml-2 w-4 h-4" />
-        </el-tag>
-        <el-tag
-          v-if="detail.archivesId"
-          class="cursor-copy"
-          size="large"
-          v-copy:click="detail.archivesId || '-'"
-        >
-          <span class="align-middle select-none"
-            >关联档案号:{{ detail.archivesId || "-" }}</span
-          >
-          <CopyDocument class="inline-block align-middle ml-2 w-4 h-4" />
-        </el-tag>
-        <span class="align-middle">左屏:</span>
-        <el-select v-model="leftView" class="w-32">
-          <el-option
-            v-for="(item, index) in viewOptions"
-            :key="index"
-            :value="item.val"
-            :label="item.label"
-            :disabled="rightView == item.val"
-          ></el-option>
-        </el-select>
-        <span class="align-middle">右屏:</span>
-        <el-select v-model="rightView" class="w-32">
-          <el-option
-            v-for="(item, index) in viewOptions"
-            :key="index"
-            :value="item.val"
-            :label="item.label"
-            :disabled="leftView == item.val"
-          ></el-option>
-        </el-select>
-        <template v-if="rightView == 4 && pdfResultList.length > 1">
-          <el-select v-model="curPdfTemplate" filterable>
-            <el-option
-              v-for="(item, index) in pdfResultList"
-              :key="index"
-              :label="item.pdfTemplate?.template.name"
-              :value="index"
-            ></el-option>
-          </el-select>
-        </template>
-      </div>
-      <div>
-        <el-button type="primary" link @click="router.back()">
-          <Fold class="h-4 w-4 mr-2" />
-          <span>返回</span>
-        </el-button>
-      </div>
-    </div>
-    <div class="data-container">
-      <el-row class="h-full">
-        <el-col
-          v-show="containerView.includes(1)"
-          :style="{
-            order: containerView.findIndex(v => v == 1)
-          }"
-          :span="containerView.length > 1 ? 12 : 24"
-
-          class="h-full overflow-y-auto"
-        >
-          <div
-            v-if="detail.files.length > 1 && curFileType != 'img'"
-            class="h-8 flex justify-center items-center space-x-4"
-          >
-            <div
-              class="flex items-center text-blue-500 hover:text-blue-700 cursor-pointer"
-              @click="curFileIdx--"
-            >
-              <ArrowLeft class="h-4 w-4" /><span>上一份</span>
-            </div>
-            <span>{{ curFileIdx + 1 }}/{{ detail.files.length }}</span>
-            <div
-              class="flex items-center text-blue-500 hover:text-blue-700 cursor-pointer"
-              @click="curFileIdx++"
-            >
-              <span>下一份</span><ArrowRight class="h-4 w-4" />
-            </div>
-          </div>
-          <template v-if="curFileType == 'pdf'">
-            <Webview
-              :url="formatFileUrlProtocol(detail.files[curFileIdx].fileUrl)"
-              class="w-full h-full"
-            />
-          </template>
-          <template v-else-if="curFileType == 'img'">
-            <div v-for="(item, index) in detail.files" :key="index">
-              <img
-                :src="formatFileUrlProtocol(item.fileUrl)"
-                alt=""
-                class="w-full h-fit select-none"
-              />
-
-            </div>
-          </template>
-          <template v-else-if="curFileType == 'json'">
-            <json-viewer
-              v-if="detail.files[curFileIdx].jsonData"
-              :value="detail.files[curFileIdx].jsonData"
-              :show-array-index="false"
-              boxed
-              expanded
-              preview-mode
-            >
-            </json-viewer>
-          </template>
-          <el-empty
-            v-else
-            description="未上传原始数据或者不支持的文件类型"
-          ></el-empty>
-        </el-col>
-        <el-col
-          v-show="containerView.includes(2)"
-          :style="{
-            order: containerView.findIndex(v => v == 2)
-          }"
-          :span="containerView.length > 1 ? 12 : 24"
-          class="h-full overflow-y-auto"
-        >
-          <el-card
-            v-for="(item, index) in transferRawJson"
-            :key="index"
-            class="mb-4"
-            shadow="never"
-          >
-            <div class="p-2 text-blue-600">检查数据</div>
-            <el-table :data="item.bodyData">
-              <el-table-column
-                label="身体物质/部位"
-                prop="name"
-              ></el-table-column>
-              <el-table-column
-                label="检查项目"
-                prop="itemName"
-              ></el-table-column>
-              <el-table-column label="结果" prop="value"></el-table-column>
-              <el-table-column
-                label="参考范围"
-                prop="reference"
-              ></el-table-column>
-              <el-table-column label="单位" prop="unit"></el-table-column>
-            </el-table>
-            <div class="mt-2 p-2 text-yellow-600">异常项目</div>
-            <el-table :data="item.abnormalData">
-              <el-table-column
-                label="异常项目"
-                prop="name"
-                width="200"
-              ></el-table-column>
-              <el-table-column label="结果">
-                <template #default="{ row }">
-                  <div v-if="row.value" class="space-x-2 space-y-2">
-                    <el-tag
-                      v-for="(val, valKey) in row.value"
-                      :key="valKey"
-                      type="warning"
-                    >
-                      <span>{{ valKey }}</span
-                      >:
-                      <span>{{ val }}</span>
-                    </el-tag>
-                  </div>
-                </template>
-              </el-table-column>
-            </el-table>
-          </el-card>
-        </el-col>
-        <el-col
-          v-show="containerView.includes(3)"
-          :style="{
-            order: containerView.findIndex(v => v == 3)
-          }"
-          :span="containerView.length > 1 ? 12 : 24"
-          class="h-full overflow-y-auto"
-        >
-          <el-scrollbar>
-            <json-viewer
-              v-if="detail.resultRawJson"
-              :value="detail.resultRawJson"
-              :show-array-index="false"
-              boxed
-              expanded
-              preview-mode
-            >
-            </json-viewer>
-          </el-scrollbar>
-        </el-col>
-        <el-col
-          v-show="containerView.includes(4)"
-          :style="{
-            order: containerView.findIndex(v => v == 4)
-          }"
-          :span="containerView.length > 1 ? 12 : 24"
-          class="h-full"
-        >
-          <Webview
-            v-if="pdfResultList[curPdfTemplate]?.pdfTransferResultUrl"
-            :url="
-              formatFileUrlProtocol(
-                pdfResultList[curPdfTemplate]?.pdfTransferResultUrl
-              )
-            "
-            class="w-full h-full"
-          />
-          <el-empty v-else description="暂无分析报告"></el-empty>
-        </el-col>
-        <el-col
-          v-show="containerView.includes(8)"
-          :style="{
-            order: containerView.findIndex(v => v == 8)
-          }"
-          :span="containerView.length > 1 ? 12 : 24"
-          class="h-full overflow-y-auto"
-        >
-          <component
-            v-if="[4].includes(detail.type) && CompCheckData"
-            :is="CompCheckData"
-          ></component>
-        </el-col>
-        <el-col
-          v-show="containerView.includes(5)"
-          :style="{
-            order: containerView.findIndex(v => v == 5)
-          }"
-          :span="containerView.length > 1 ? 12 : 24"
-          class="h-full overflow-y-auto"
-        >
-          <component
-            v-if="[6, 7].includes(detail.type) && VisitsFillData"
-            :is="VisitsFillData"
-          ></component>
-        </el-col>
-        <el-col
-          v-show="containerView.includes(6)"
-          :style="{
-            order: containerView.findIndex(v => v == 6)
-          }"
-          :span="containerView.length > 1 ? 12 : 24"
-          class="h-full overflow-y-auto"
-        >
-
-          <component
-            v-if="[2].includes(detail.type) && MonitoringData"
-            :is="MonitoringData"
-          ></component>
-        </el-col>
-        <el-col
-          v-show="containerView.includes(7)"
-          :style="{
-            order: containerView.findIndex(v => v == 7)
-          }"
-          :span="containerView.length > 1 ? 12 : 24"
-          class="h-full overflow-y-auto"
-        >
-
-          <component
-            v-if="[3].includes(detail.type) && DiseaseVisitData"
-            :is="DiseaseVisitData"
-            :form-show="true"
-          ></component>
-        </el-col>
-      </el-row>
-    </div>
-  </div>
-</template>
-
-<script setup>
-import {
-  computed,
-  watch,
-  ref,
-  reactive,
-  onMounted,
-  shallowRef,
-  provide,
-  defineAsyncComponent
-} from "vue";
-import { useRoute, useRouter } from "vue-router";
-import {
-  CopyDocument,
-  Fold,
-  ArrowLeft,
-  ArrowRight
-} from "@element-plus/icons-vue";
-import { ElMessage } from "element-plus";
-import { request, parseJsonData, findScope } from "@/utils";
-import JsonViewer from "vue-json-viewer";
-import Webview from "@/components/WebView.vue";
-import dayjs from "dayjs";
-// import VisitsFillData from './components/VisitsFillData.vue';
-const VisitsFillData = defineAsyncComponent(() =>
-  import("./components/VisitsFillData.vue")
-);
-const DiseaseVisitData = defineAsyncComponent(() =>
-  import("./components/DiseaseVisitData.vue")
-);
-const MonitoringData = defineAsyncComponent(() =>
-  import("@/views/dataCenter/components/MonitoringData.vue")
-);
-const CompCheckData = defineAsyncComponent(() =>
-  import("@/views/dataCenter/components/CompCheckData.vue")
-);
-const [route, router] = [useRoute(), useRouter()];
-const sn = provide("sn", route.query.sn);
-const leftView = ref(1);
-const rightView = ref(2);
-const containerView = computed(() => {
-  return [leftView.value, rightView.value].filter(v => v > 0);
-});
-
-const viewOptions = ref([]);
-const originViewOptions = [
-  {
-    label: "隐藏视图",
-    val: -1
-  },
-  {
-    label: "原始数据",
-    val: 1
-  }
-];
-const viewOptionsMap = {
-  1: [
-    {
-      label: "处理后的数据",
-      val: 2
-    },
-    // {
-    //   label: "分析结果",
-    //   val: 3
-    // },
-    // {
-    //   label: "分析报告",
-    //   val: 4
-    // }
-  ],
-  2: [
-    {
-      label: "处理后的数据",
-      val: 6
-    }
-  ],
-  3: [
-    {
-      label: "处理后的数据",
-      val: 7
-    }
-  ],
-  4: [
-    {
-      label: "处理后的数据",
-      val: 8
-    }
-  ],
-  6: [
-    {
-      label: "填写数据",
-      val: 5
-    }
-  ],
-  7: [
-    {
-      label: "填写数据",
-      val: 5
-    }
-  ]
-};
-const defaultView = {
-  1: 2,
-  2: 6,
-  3: 7,
-  4: 8,
-  6: 5,
-  7: 5,
-};
-const curFileIdx = ref(0);
-watch(
-  () => curFileIdx.value,
-  idx => {
-    if (idx < 0) {
-      curFileIdx.value = detail.value.files.length - 1;
-    } else if (idx > detail.value.files.length - 1) {
-      curFileIdx.value = 0;
-    }
-  }
-);
-const detail = ref({
-  sn: "",
-  archivesId: "",
-  transferRawJson: [],
-  files: []
-});
-const curFileType = computed(() => {
-  const curFile = detail.value.files[curFileIdx.value];
-  if (curFile) {
-    const afterFix = curFile.fileUrl.split(".").at(-1).toLocaleLowerCase();
-    if (
-      [
-        "gif",
-        "png",
-        "jpg",
-        "jpeg",
-        "webp",
-        "svg",
-        "psd",
-        "bmp",
-        "tif"
-      ].includes(afterFix)
-    )
-      return "img";
-    return afterFix;
-  }
-  return "";
-});
-const archivesId = ref()
-const transferRawJson = ref([]);
-const transferRawJsonFormId = ref();
-const transferRawJsonDiseaseId = ref();
-const formatFileUrlProtocol = url => url.replace(/^https?:/, location.protocol);
-const getDetail = async () => {
-  const { data } = await request.get(`/medicalData/detail`, {
-    params: {
-      sn: route.query.sn
-    }
-  });
-  for (const file of data.detail.files) {
-    if (file.fileUrl.split(".").at(-1) == "json") {
-      const jsonData = await request.get(file.fileUrl);
-      console.log(jsonData);
-      file.jsonData = jsonData;
-    }
-  }
-  try {
-    data.detail.resultRawJson = parseJsonData(data.detail.resultRawJson, []);
-    const temp = parseJsonData(data.detail.transferRawJson);
-    transferRawJson.value = temp?.answers || temp || [];
-    transferRawJsonFormId.value = temp?.formId;
-    transferRawJsonDiseaseId.value = temp?.diseaseId;
-  } catch (error) {
-    console.log(error);
-  }
-  viewOptions.value = [
-    ...originViewOptions,
-    ...(viewOptionsMap[data.detail.type] || [])
-  ];
-  rightView.value = defaultView[data.detail.type];
-
-  detail.value = data.detail;
-  archivesId.value = data.detail.archivesId;
-  if ([2].includes(data.detail.type)) {
-    leftView.value = -1;
-    transferRawJson.value[0].bodyData.forEach(v => {
-      v.date = dayjs(v.date * 1000).format("YYYY-MM-DD HH:mm:ss");
-    });
-  }
-  getPdfResultList(detail.value);
-};
-provide("transferRawJson", transferRawJson);
-provide("formId", transferRawJsonFormId);
-provide("archivesId", archivesId);
-provide("transferRawJsonDiseaseId", transferRawJsonDiseaseId);
-provide("getDetail", getDetail);
-
-const curPdfTemplate = ref(0);
-const pdfResultList = ref([]);
-const getPdfResultList = async row => {
-  const { data } = await request.get(
-    `/idcService/mechanism/medicalData/pdfResult/list`,
-    {
-      params: { sn: row.sn }
-    }
-  );
-  pdfResultList.value = data.list || [];
-};
-onMounted(() => {
-  getDetail();
-});
-</script>
-
-<style lang="scss">
-.el-scrollbar__view {
-  height: 100%;
-  .main-content.page-check-data {
-    margin: 0;
-  }
-}
-.page-check-data {
-  .data-container {
-    height: calc(100% - 48px);
-    width: 100%;
-  }
-}
-</style>

+ 0 - 595
src/views/dataCenter/components/ArchivesModule.vue

@@ -1,595 +0,0 @@
-<template>
-  <div
-    class="page-archives-module"
-    :class="{
-      'pb-32': !props.isPlat
-    }"
-  >
-    <div
-      v-if="curIdx >= 0"
-      class="mx-4"
-      :class="{
-        'rounded-lg bg-white': props.isPlat
-      }"
-    >
-      <div
-        v-for="(item, index) in list"
-        :key="index"
-        :class="{
-          'py-2 px-4 border-0 border-b last:border-b-0 hover:bg-gray-50 border-gray-100 border-solid':
-            props.isPlat,
-          'py-2 px-4 bg-white mb-2 rounded-lg': !props.isPlat,
-          'active:bg-gray-100': !props.isPlat && !item.isModule
-        }"
-        @click="goEditArchives(item)"
-      >
-        <div v-if="!props.isPlat && item.isModule" class="border-0">
-          <div class="text-lg leading-8">{{ item.name }}</div>
-          <div
-            v-for="(child, childIdx) in item.children"
-            :key="childIdx"
-            class="py-2 px-4 border-0 border-b last:border-b-0 active:bg-gray-100 border-gray-100 border-solid"
-            @click="goEditArchives(child)"
-          >
-            <div class="flex flex-row justify-between items-center">
-              <div>
-                <div class="text-lg leading-8">{{ child.name }}</div>
-                <div class="text-gray-500 text-base">
-                  <div
-                    v-for="(
-                      moduleVal, moduleValIndex
-                    ) in formateArchivesModuleValue(child, false)"
-                    :key="moduleValIndex"
-                  >
-                    <template v-if="moduleVal.isPlaceholder">
-                      <div v-html="moduleVal.value" :style="moduleVal.style"></div
-                    ></template>
-                    <template v-else>
-                      <span>{{ moduleVal.label }}</span>
-                      <template v-if="moduleVal.opt?.isFile">
-                        <span class="align-middle">:</span>
-                        <div
-                          v-for="(val, valIdx) in moduleVal.value"
-                          :key="valIdx"
-                          class="inline-block mr-2 drop-shadow"
-                        >
-                          <el-image
-                            v-if="moduleVal.opt?.isImage(val.url)"
-                            :src="val.url"
-                            :alt="val.name"
-                            :preview-src-list="moduleVal.value.map(v => v.url)"
-                            preview-teleported
-                            :initial-index="valIdx"
-                            fit="cover"
-                            class="h-12 w-12 rounded align-middle"
-                          ></el-image>
-                          <el-button
-                            v-else
-                            class="align-middle"
-                            type="primary"
-                            link
-                            tag="a"
-                            :download="val.name"
-                            :href="
-                              val.url +
-                              '?response-content-type=application/octet-stream'
-                            "
-                            target="_blank"
-                            >下载附件</el-button
-                          >
-                        </div>
-                      </template>
-                      <span v-else class="text-gray-400"
-                        >:{{ moduleVal.value }}{{ moduleVal.unit }}</span
-                      >
-                      <div v-if="moduleVal.date">
-                        <span>检查时间:</span
-                        ><span class="text-gray-400">{{ moduleVal.date }}</span>
-                      </div>
-                    </template>
-                  </div>
-                </div>
-              </div>
-              <ArrowRight
-                v-if="!!(route.query.isSelf || route.query.isOwner)"
-                class="text-gray-400"
-              />
-            </div>
-          </div>
-        </div>
-        <div v-else class="flex flex-row justify-between items-center">
-          <div>
-            <div class="text-lg leading-8">{{ item.name }}</div>
-            <div v-if="item.isModule" class="pl-4">
-              <div v-for="(child, childIdx) in item.children" :key="childIdx">
-                <div>
-                  <div
-                    v-for="(
-                      moduleVal, moduleValIndex
-                    ) in formateArchivesModuleValue(child, false)"
-                    :key="moduleValIndex"
-                    class="py-2"
-                    :class="{
-                      'pl-2': moduleVal.isChild
-                    }"
-                  >
-                    <template v-if="moduleVal.isPlaceholder">
-                      <div v-html="moduleVal.value" :style="moduleVal.style"></div
-                    ></template>
-                    <template v-else>
-                      <span>{{ moduleVal.label }}</span>
-                      <template v-if="!moduleVal.isLabel">
-                        <template v-if="moduleVal.opt?.isFile">
-                          <span class="align-middle">:</span>
-                          <div
-                            v-for="(val, valIdx) in moduleVal.value"
-                            :key="valIdx"
-                            class="inline-block mr-2 drop-shadow"
-                          >
-                            <el-image
-                              v-if="moduleVal.opt?.isImage(val.url)"
-                              :src="val.url"
-                              :alt="val.name"
-                              :preview-src-list="
-                                moduleVal.value.map(v => v.url)
-                              "
-                              preview-teleported
-                              :initial-index="valIdx"
-                              fit="cover"
-                              class="h-12 w-12 rounded align-middle"
-                            ></el-image>
-                            <el-button
-                              v-else
-                              class="align-middle"
-                              type="primary"
-                              link
-                              tag="a"
-                              :download="val.name"
-                              :href="
-                                val.url +
-                                '?response-content-type=application/octet-stream'
-                              "
-                              target="_blank"
-                              >下载附件</el-button
-                            >
-                          </div>
-                        </template>
-                        <span v-else class="text-gray-400"
-                          >:{{ moduleVal.value }}{{ moduleVal.unit }}</span
-                        >
-                      </template>
-                      <div v-if="moduleVal.date">
-                        <span>检查时间:</span
-                        ><span class="text-gray-400">{{ moduleVal.date }}</span>
-                      </div>
-                    </template>
-                  </div>
-                </div>
-              </div>
-              <div
-                v-if="!item.children.find(v => v.hasValue)"
-                class="text-gray-400"
-              >
-                暂未填写
-              </div>
-            </div>
-            <div v-else class="text-gray-500 text-base">
-              <div
-                v-for="(
-                  moduleVal, moduleValIndex
-                ) in formateArchivesModuleValue(item, false)"
-                :key="moduleValIndex"
-              >
-                <template v-if="moduleVal.isPlaceholder">
-                  <div v-html="moduleVal.value" :style="moduleVal.style"></div
-                ></template>
-                <template v-else>
-                  <span>{{ moduleVal.label }}</span>
-                  <template v-if="!moduleVal.isLabel">
-                    <template v-if="moduleVal.opt?.isFile">
-                      <span class="align-middle">:</span>
-                      <div
-                        v-for="(val, valIdx) in moduleVal.value"
-                        :key="valIdx"
-                        class="inline-block mr-2 drop-shadow"
-                      >
-                        <el-image
-                          v-if="moduleVal.opt?.isImage(val.url)"
-                          :src="val.url"
-                          :alt="val.name"
-                          :preview-src-list="moduleVal.value.map(v => v.url)"
-                          preview-teleported
-                          :initial-index="valIdx"
-                          fit="cover"
-                          class="h-12 w-12 rounded align-middle"
-                        ></el-image>
-                        <el-button
-                          v-else
-                          class="align-middle"
-                          type="primary"
-                          link
-                          tag="a"
-                          :download="val.name"
-                          :href="
-                            val.url +
-                            '?response-content-type=application/octet-stream'
-                          "
-                          target="_blank"
-                          >下载附件</el-button
-                        >
-                      </div>
-                    </template>
-                    <span v-else class="text-gray-400"
-                      >:{{ moduleVal.value }}{{ moduleVal.unit }}</span
-                    >
-                  </template>
-                  <div v-if="moduleVal.date">
-                    <span>检查时间:</span
-                    ><span class="text-gray-400">{{ moduleVal.date }}</span>
-                  </div>
-                </template>
-              </div>
-
-              <div v-if="!item.hasValue" class="text-gray-400">暂未填写</div>
-            </div>
-          </div>
-          <div v-if="props.isPlat">
-            <el-button type="primary" link @click="editArchivesModule(item)"
-              >编辑数据</el-button
-            >
-            <!-- <el-button type="primary" link @click="item.type == 2 ? showPatIndicator(item) : editArchivesModule(item)">查看历史数据</el-button> -->
-          </div>
-          <ArrowRight
-            v-else-if="
-              !item.isModule && !!(route.query.isSelf || route.query.isOwner)
-            "
-            class="text-gray-400"
-          />
-        </div>
-      </div>
-    </div>
-
-    <el-dialog
-      v-model="platEditFileConfig.show"
-      :title="platEditFileConfig.indicator?.name"
-      fullscreen
-      style="width: 50%; margin-right: 0"
-    >
-      <div class="p-4">
-        <EditArchivesModule
-          v-if="platEditFileConfig.show"
-          is-plat
-          :indicator="platEditFileConfig.indicator"
-          :id="platEditFileConfig.id"
-          :module-id="platEditFileConfig.moduleId"
-          @close="editFileClose"
-        />
-      </div>
-    </el-dialog>
-
-    <el-drawer
-      v-model="submoduleConfig.show"
-      direction="rtl"
-      class="filter-container w-full rounded-l-lg"
-      :with-header="false"
-      size="60%"
-    >
-      <h3 class="text-xl mb-4">{{ submoduleConfig.name }}</h3>
-      <div class="rounded-lg bg-gray-50 overflow-hidden">
-        <div
-          v-for="(item, index) in submoduleConfig.list"
-          :key="index"
-          class="py-2 px-4 border-0 border-b last:border-b-0 hover:bg-gray-100 border-gray-200 border-solid"
-        >
-          <div class="flex flex-row justify-between items-center">
-            <div>
-              <div class="text-lg leading-8">{{ item.name }}</div>
-              <div class="text-gray-500 text-base">
-                <div
-                  v-for="(
-                    moduleVal, moduleValIndex
-                  ) in formateArchivesModuleValue(item, true)"
-                  :key="moduleValIndex"
-                >
-                  <span>{{ moduleVal.label }}</span>
-                  <span class="text-gray-400"
-                    >:{{ moduleVal.value }}{{ moduleVal.unit }}</span
-                  >
-                  <div v-if="moduleVal.date">
-                    <span>检查时间:</span
-                    ><span class="text-gray-400">{{ moduleVal.date }}</span>
-                  </div>
-                </div>
-                <div v-if="!item.hasValue" class="text-gray-400">暂未填写</div>
-              </div>
-            </div>
-            <el-button type="primary" link @click="editArchivesModule(item)"
-              >编辑数据</el-button
-            >
-          </div>
-        </div>
-      </div>
-    </el-drawer>
-  </div>
-</template>
-<script setup>
-import {
-  computed,
-  watch,
-  ref,
-  reactive,
-  inject,
-  onActivated,
-  onMounted,
-  defineAsyncComponent
-} from "vue";
-import { useRoute, useRouter } from "vue-router";
-import { request, formateArchivesModuleValue, deepClone } from "@/utils";
-import EditArchivesModule from "./EditArchivesModule.vue";
-
-import { ArrowRight } from "@element-plus/icons-vue";
-const props = defineProps({
-  isPlat: {
-    type: Boolean,
-    default: false
-  },
-  form: {
-    type: Object,
-    default: undefined
-  },
-  moduleId: {
-    type: String,
-    default: undefined
-  }
-});
-const list = ref([]);
-const test = ref();
-
-const route = useRoute();
-const router = useRouter();
-const curIdx = ref(0);
-const moduleList = ref([]);
-
-const getMobileModules = async (isInit = true) => {
-  const { data } = await request.get(`/archivesService/api/module/list`);
-  const moduleMenu = data.list?.map(v => {
-    return {
-      icon: v.icon,
-      selectIcon: v.icon,
-      name: v.name,
-      id: v.id,
-      value: v.id
-    };
-  });
-  moduleList.value = moduleMenu;
-  moduleList.value.length && isInit && fetchModuleIndicators();
-};
-
-const fetchModuleIndicators = async () => {
-  list.value = props?.form?.fields || [];
-  console.log(list.value);
-  list.value?.length && getFillFormData();
-};
-const transferRawJson = inject("transferRawJson");
-const getFillFormData = async () => {
-  const returnAnswer = {};
-  (transferRawJson.value || []).forEach((v, k) => {
-    returnAnswer[v.answer?.questionNo] = v.answer;
-  });
-  console.log("return answer", returnAnswer);
-
-  fillFormData(list.value, returnAnswer);
-  console.log("test", list.value);
-};
-const fillFormData = (arr, data) => {
-  arr.forEach(v => {
-    if (v.fields?.length) {
-      v.fields.forEach(filed => {
-        if (filed.extra?.subjects) {
-          filed.extra?.subjects.forEach(subject => {
-            subject.returnAnswer = data[subject.sn];
-          });
-        } else {
-          if (filed.extra?.sn) {
-            filed.extra.returnAnswer = data[filed.extra.sn];
-          }
-        }
-      });
-    }
-    if (v.extra?.subjects) {
-      v.extra?.subjects.forEach(subject => {
-        subject.returnAnswer = data[subject.sn];
-      });
-    } else {
-      if (v.extra?.sn) {
-        v.extra.returnAnswer = data[v.extra.sn];
-      }
-    }
-  });
-  return arr;
-};
-watch(
-  () => [props.form, transferRawJson.value],
-  () => {
-    fetchModuleIndicators();
-  },
-  {
-    immediate: true
-  }
-);
-const back = () => {
-  router.back();
-};
-const transformData = list => {
-  const result = [];
-  const pId = {};
-  list.forEach((v, k) => {
-    if (!v.parentId) {
-      return result.push(v);
-    }
-    if (!pId[v.parentId] && pId[v.parentId] !== 0) {
-      pId[v.parentId] = result.length;
-      result.push({
-        ...v.parent,
-        isModule: true,
-        children: [v]
-      });
-    } else {
-      result[pId[v.parentId]].children.push(v);
-    }
-  });
-  return result;
-};
-
-const changeHealthFile = async (item, index) => {
-  curIdx.value = index;
-  if (index > -1) {
-    fetchModuleIndicators();
-  }
-};
-const editFileClose = async (flag = false) => {
-  platEditFileConfig.show = flag;
-  console.log("触发close");
-  await fetchModuleIndicators();
-  if (submoduleConfig.show) {
-    submoduleConfig.list =
-      list.value.find(v => submoduleConfig.id == v.id)?.fields || [];
-  }
-};
-
-const platEditFileConfig = reactive({
-  show: false,
-  id: "",
-  indicator: undefined,
-  moduleId: undefined
-});
-const submoduleConfig = reactive({
-  show: false,
-  id: "",
-  list: [],
-  name: ""
-});
-const goEditArchives = item => {
-  if (item.isModule || props.isPlat) {
-    return;
-  }
-  editArchivesModule(item);
-};
-const editArchivesModule = item => {
-  if (item.type == 1) {
-    submoduleConfig.list = item.fields || [];
-    submoduleConfig.name = item.name;
-    submoduleConfig.id = item.id;
-    submoduleConfig.show = true;
-    console.log(item);
-  } else if (props.isPlat) {
-    platEditFileConfig.id = props.id;
-    platEditFileConfig.moduleId = props.moduleId;
-    platEditFileConfig.indicator = item;
-    platEditFileConfig.show = true;
-    console.log(platEditFileConfig);
-  } else {
-  }
-};
-const platIndicatorHistory = reactive({
-  show: false,
-  id: "",
-  archivesId: "",
-  label: "",
-  unit: "",
-  total: 0,
-  item: undefined,
-  list: []
-});
-
-const getPlatIndicatorHistory = async () => {
-  const { data } = await request.get(
-    `/archivesServiceV2/mechanism/archives/indicator/history/list`,
-    {
-      params: {
-        extraId: platIndicatorHistory.id,
-        type: 2,
-        archivesId: platIndicatorHistory.archivesId
-      }
-    }
-  );
-  platIndicatorHistory.list = (data.list || []).map(v => {
-    const temp = deepClone(platIndicatorHistory.item);
-    temp.archivesIndicator.surveyTemplateRawValue = v.surveyTemplateRawValue;
-
-    return {
-      ...v,
-      values: formateArchivesModuleValue(temp)
-    };
-  });
-  console.log(platIndicatorHistory.list);
-};
-const showPatIndicator = item => {
-  platIndicatorHistory.label = item.name;
-  platIndicatorHistory.unit = item.unit;
-  platIndicatorHistory.id = item.extraId;
-  platIndicatorHistory.item = item;
-  console.log(item);
-
-  platIndicatorHistory.archivesId = props.isPlat ? props.id : route.query.id;
-  getPlatIndicatorHistory();
-  platIndicatorHistory.show = true;
-};
-
-onActivated(() => {
-  const refreshArchives = !!sessionStorage.getItem("refreshArchives");
-  refreshArchives && fetchModuleIndicators();
-});
-</script>
-<style lang="scss">
-.page-archives-module {
-  .healthy-file-list {
-    padding: 15px;
-    white-space: nowrap;
-    overflow: hidden;
-    overflow-x: auto;
-    background-color: #f6f6f6;
-    .healthy-file-item {
-      display: inline-flex;
-      justify-content: center;
-      align-items: center;
-      flex-direction: column;
-      background: #fff;
-      border-radius: 8px;
-      padding: 10px;
-      font-size: 14px;
-      box-shadow: 0px 3px 9px 1px rgba(175, 202, 222, 0.16);
-      border: 1px solid #fff;
-      &:not(:last-of-type) {
-        margin-right: 10px;
-      }
-      &.active {
-        color: #4b72f6;
-        background: #fff;
-        border: 1px solid #4b72f6;
-        box-shadow: 0px 3px 6px 1px rgba(68, 68, 68, 0.16);
-      }
-      .file-item-icon {
-        width: 32px;
-        height: 32px;
-      }
-      .file-item-name {
-        margin-top: 6px;
-        min-width: 4em;
-        line-height: 1em;
-        text-align: center;
-      }
-    }
-  }
-
-  .child-item {
-    & + .child-item {
-      margin-top: 5px;
-    }
-    .label {
-      // color: #444;
-      font-weight: bold;
-    }
-  }
-}
-</style>

+ 0 - 143
src/views/dataCenter/components/CompCheckData.vue

@@ -1,143 +0,0 @@
-<template>
-  <div>
-    <div v-if="transferRawJson" class="p-2">
-      <div
-        class="bg-white rounded mb-2 p-2 flex items-center justify-between space-x-2"
-      >
-        <span class="text-yellow-600 text-sm"
-          >提示:录入的数据最终会对应成系统内置项目/检查名称,查询用户检查数据时,以系统内置项目/检查名称为准</span
-        >
-        <el-button type="primary" link @click="toEdit">
-          <Edit class="w-4 h-4" />
-          <span>修改数据</span>
-        </el-button>
-      </div>
-      <div
-        v-for="(item, index) in transferRawJson"
-        :key="index"
-        class="bg-white rounded mb-4"
-      >
-        <div
-          class="flex justify-between items-center text-sm text-gray-500 p-4"
-        >
-          <span>{{ item.groupName }}</span>
-          <span
-            >检查时间:{{
-              dayjs(item.date * 1000).format("YYYY-MM-DD HH:mm:ss")
-            }}</span
-          >
-        </div>
-        <div class="p-2">
-          <el-table :data="item?.bodyData">
-            <el-table-column
-              label="项目名称"
-              prop="originalName"
-            ></el-table-column>
-            <el-table-column label="检查结果" prop="value"></el-table-column>
-            <el-table-column label="单位" prop="unit"></el-table-column>
-            <el-table-column
-              label="参考范围"
-              prop="reference"
-            ></el-table-column>
-            <el-table-column label="对应系统项目名称" prop="name">
-            </el-table-column>
-            <el-table-column label="对应系统检查名称" prop="itemName">
-            </el-table-column>
-          </el-table>
-          <div
-            v-if="item.abnormalData?.length"
-            class="p-2 bg-gray-50 rounded mt-4"
-          >
-            <div class="py-2 mb-2 text-sm text-gray-700">异常内容</div>
-            <table class="w-full table-fixed">
-              <tr class="text-left text-sm text-gray-500">
-                <th class="border border-gray-200 p-2">项目名称</th>
-                <th class="border border-gray-200 p-2">异常项目</th>
-                <th class="border border-gray-200 p-2">异常值</th>
-              </tr>
-              <tr
-                v-for="(abnormal, abnormalIdx) in filterAbnormalBodyData(item)"
-                :key="abnormalIdx"
-                class="border border-gray-200 text-sm text-gray-500"
-              >
-                <td class="p-2 border border-gray-200">{{ abnormal.name }}</td>
-                <td class="border border-gray-200">
-                  <div
-                    v-for="(child, childIdx) in abnormal.abnormalDatas"
-                    :key="childIdx"
-                    class="p-2 border-b last:border-b-0 border-gray-200"
-                  >
-                    {{ child.name }}
-                  </div>
-                </td>
-                <td class="p-2 border border-gray-200">
-                  <div
-                    v-for="(child, childIdx) in abnormal.abnormalDatas"
-                    :key="childIdx"
-                    class="p-2 border-b last:border-b-0 border-gray-200 whitespace-pre-wrap"
-                    v-html="formatValue(child.value)"
-                  >
-                  </div>
-                </td>
-              </tr>
-            </table>
-          </div>
-        </div>
-      </div>
-    </div>
-  </div>
-</template>
-<script setup>
-import {
-  computed,
-  watch,
-  ref,
-  reactive,
-  onMounted,
-  shallowRef,
-  provide,
-  inject,
-  defineAsyncComponent
-} from "vue";
-
-import { useRoute, useRouter } from "vue-router";
-import {
-  Edit,
-  CopyDocument,
-  Fold,
-  ArrowLeft,
-  ArrowRight
-} from "@element-plus/icons-vue";
-import { ElMessage } from "element-plus";
-import { request, parseJsonData, findScope } from "@/utils";
-import dayjs from "dayjs";
-
-const [route, router] = [useRoute(), useRouter()];
-
-const getDetail = inject("getDetail");
-const transferRawJson = inject("transferRawJson");
-
-const filterAbnormalBodyData = item =>
-  item.bodyData.filter(v => v.abnormalDatas?.length);
-const toEdit = () => {
-  router.push({
-    name: "dataUploadCheckData",
-    query: {
-      sn: route.query.sn
-    }
-  });
-};
-const formatValue = (value) => {
-  if (value) {
-    if (Object.prototype.toString.call(value).slice(8, -1).toLocaleLowerCase() == 'object') {
-      return Object.keys(value).map(k => `${k}:${value[k]}`).join('\n')
-    } else {
-      return value
-    }
-  } else {
-    return value === 0 ? 0 : "-"
-  }
-}
-</script>
-
-<style lang="scss" scoped></style>

+ 0 - 235
src/views/dataCenter/components/DialogAddDataSet.vue

@@ -1,235 +0,0 @@
-<template>
-  <div>
-    <el-dialog
-      title="新增数据集"
-      v-model="dialogVisible"
-      :close-on-click-modal="false"
-    >
-      <div v-if="!state.dataDetectionVisible">
-        <div>
-          <h3>
-            请下载模板文件,按照模板文件数据格式 填充数据后上传,否则会上传失败
-          </h3>
-          <div class="mt-3">
-            <div class="flex items-center mb-2">
-              <img src="@/assets/excel.png" style="width: 50px; height: 50px" />
-              <el-link
-                @click="
-                  handleDown(
-                    '体检数据excel模板下载(数据横向展示).xlsx',
-                    'https://oss.mdfitnesscao.com/merchant/XDYDMc51tt48Mx77yMYT0Kf1RpCBQSy71EahFphiTPj5NDRe.xlsx'
-                  )
-                "
-              >
-                体检数据excel模板下载(数据横向展示)
-              </el-link>
-            </div>
-            <div class="flex items-center">
-              <img src="@/assets/excel.png" style="width: 50px; height: 50px" />
-              <el-link
-                @click="
-                  handleDown(
-                    '体检数据excel模板下载(数据纵向展示).xlsx',
-                    'https://oss.mdfitnesscao.com/merchant/AGEHCBk67XfaJthNcTjtcdWDSTRT7YjmKFkAcHZ3knN6F4JK.xlsx'
-                  )
-                "
-                >体检数据excel模板下载(数据纵向展示)</el-link
-              >
-            </div>
-          </div>
-        </div>
-        <el-divider></el-divider>
-        <div>
-          <el-form ref="form" label-width="100px" label-position="left">
-            <el-form-item label="数据集名称:">
-              <el-input
-                v-model="state.name"
-                placeholder="请输入本次数据集名称,方便搜索"
-              ></el-input>
-            </el-form-item>
-          </el-form>
-        </div>
-        <div>
-          <el-upload
-            class="upload-demo"
-            v-model:file-list="state.uploadFiles"
-            ref="uploadRef"
-            drag
-            action="#"
-            :auto-upload="false"
-            multiple
-          >
-            <el-icon class="el-icon--upload"><upload-filled /></el-icon>
-            <div class="el-upload__text">拖拽文件或者<em>点击上传</em></div>
-            <template #tip>
-              <div class="el-upload__tip">上传Excel数据文件</div>
-            </template>
-          </el-upload>
-        </div>
-      </div>
-      <div v-else>
-        <div
-          class="flex items-center pl-2 pr-2"
-          style="background: var(--el-color-warning-light-7)"
-        >
-          <span style="color: #f56c6c" v-if="state.loading"
-            >数据格式检测中,请稍后...</span
-          >
-          <span style="color: #67c23a" v-else>数据检测完毕</span>
-          <el-button type="primary" link>
-            <el-icon class="el-icon--refresh ml-4"
-              ><Refresh class="fs-xs"></Refresh
-            ></el-icon>
-            刷新</el-button
-          >
-        </div>
-        <el-table
-          :data="state.uploadResult.data"
-          border
-          style="width: 100%"
-          class="mt-4"
-        >
-          <el-table-column prop="Filename" label="文件名称" />
-          <el-table-column prop="说明" label="说明">
-            <template #default="{ row }">
-              <div v-if="!row.Errs.length">
-                <div style="color: var('--el-color-success-light-3: ')">
-                  检查通过
-                </div>
-              </div>
-              <div v-for="(item, index) in row.Errs" :key="index">
-                <div style="color: #f56c6c">{{ item }}</div>
-              </div>
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-      <template #footer>
-        <div v-if="!state.dataDetectionVisible">
-          <el-button @click="dialogVisible = false">取 消</el-button>
-          <el-button type="primary" @click="handleSubmit">下一步</el-button>
-        </div>
-        <div v-else>
-          <el-button @click="() => (state.dataDetectionVisible = false)"
-            >上一步</el-button
-          >
-          <el-button
-            type="primary"
-            :disabled="state.uploadResult.code !== 200"
-            @click="
-              () => {
-                dialogVisible = false;
-                emits('success');
-              }
-            "
-            >完成</el-button
-          >
-        </div>
-      </template>
-    </el-dialog>
-  </div>
-</template>
-<script lang="ts" setup>
-import { ref, computed, defineProps, defineEmits, watch, reactive } from "vue";
-import { ElMessage, ElLoading } from "element-plus";
-import { uploadToOSS, debounce, request } from "@/utils";
-import { UploadFilled, Refresh } from "@element-plus/icons-vue";
-const props = defineProps({
-  show: {
-    type: Boolean,
-    default: false
-  }
-});
-const state = reactive({
-  name: "",
-  uploadFiles: [],
-  dataDetectionVisible: false,
-  loading: false,
-  uploadResult: {
-    code: 200,
-    data: []
-  }
-});
-const emits = defineEmits(["update:show", "success"]);
-const dialogVisible = computed({
-  get() {
-    return props.show;
-  },
-  set(n) {
-    emits("update:show", n);
-  }
-});
-
-watch(
-  () => dialogVisible.value,
-  n => {
-    if (n) {
-    } else {
-      onReset();
-    }
-  }
-);
-const onReset = () => {
-  state.dataDetectionVisible = false;
-  state.uploadResult = {
-    code: 200,
-    data: []
-  };
-  state.name = "";
-  state.uploadFiles = [];
-};
-const handleDown = (name, url) => {
-  const x = new window.XMLHttpRequest();
-  x.open("GET", url, true);
-  x.responseType = "blob";
-  x.onload = () => {
-    const url = window.URL.createObjectURL(x.response);
-    const a = document.createElement("a");
-    a.href = url;
-    a.target = "_self";
-    a.download = name;
-    a.style.display = "none";
-    a.click();
-  };
-  x.send();
-};
-const handleSubmit = async resp => {
-  let list = state.uploadFiles;
-  let formdata = new FormData();
-  if (!list.length) {
-    return ElMessage.error("请选择数据集");
-  }
-  const loading = ElLoading.service({
-    lock: true,
-    text: "开始上传",
-    background: "rgba(255, 255, 255, 0.7)"
-  });
-  formdata.append("name", state.name);
-  try {
-    let uploadCount = 0;
-    for (const item of list) {
-      // item.fileUrl = await uploadToOSS(item.raw, item.name);
-      formdata.append("upload[]", item.raw), uploadCount++;
-      // loading.text = `正在上传文件${uploadCount}/${list.length}`;
-    }
-    loading.text = `正在上传文件${uploadCount}/${list.length}`;
-    request
-      .post("/dataService/dataParse/mechanism/upload/files", formdata, {
-        headers: {
-          "Content-Type": "multipart/form-data"
-        }
-      })
-      .then(resp => {
-        state.dataDetectionVisible = true;
-        state.uploadResult = resp;
-        state.loading = false;
-        emits("success");
-      });
-    console.log("上传的文件列表", state.uploadFiles);
-  } catch (e) {
-    console.log(e);
-  }
-  loading.close();
-  state.loading = false;
-};
-</script>

+ 0 - 273
src/views/dataCenter/components/DialogRegisterData.vue

@@ -1,273 +0,0 @@
-<template>
-  <div>
-    <el-dialog title="" v-model="dialogVisible">
-      <div>
-        <div class="flex justify-between mb-3">
-          <h3 class="flex items-center">
-            本次数据集共包含
-            <h2 style="color: #f56c6c; font-size: 30px">
-              {{ state.dataCount.total }}人
-            </h2>
-            的数据,已注册
-            <h2 style="color: #f56c6c; font-size: 30px">
-              {{ state.dataCount.registered }}人
-            </h2>
-            ,未注册
-            <h2 style="color: #f56c6c; font-size: 30px">
-              {{ state.dataCount.notRegistered }}人
-            </h2>
-          </h3>
-          <el-button type="primary" plain @click="getDataCount">刷新</el-button>
-        </div>
-        <div class="mt-2" style="width: 500px">
-          <el-input
-            v-model="state.query.key"
-            placeholder="请输入搜索内容"
-            class="input-with-select"
-          >
-            <template #prepend>
-              <el-select
-                v-model="state.query.type"
-                placeholder="请选择"
-                style="width: 115px"
-                clearable
-              >
-                <el-option
-                  :label="item.name"
-                  :value="item.key"
-                  v-for="item in keyList"
-                  :key="item.type"
-                />
-              </el-select>
-            </template>
-            <template #append>
-              <el-button
-                :icon="Search"
-                @click="
-                  () => {
-                    state.query.page = 1;
-                    getUserList();
-                  }
-                "
-                >搜索</el-button
-              >
-            </template>
-          </el-input>
-        </div>
-
-        <el-table
-          :data="state.tableData"
-          ref="multipleTableRef"
-          @selection-change="handleSelectionChange"
-          class="w-full mt-4"
-        >
-          <el-table-column type="selection" width="55" />
-          <el-table-column prop="name" label="姓名"></el-table-column>
-          <el-table-column prop="gender" label="性别"></el-table-column>
-          <el-table-column label="检查时年龄 " prop="age"></el-table-column>
-          <el-table-column label="ID " prop="userId"></el-table-column>
-          <el-table-column label="手机号" prop="mobile"></el-table-column>
-          <el-table-column label="身份证号" prop="IDCard"></el-table-column>
-          <el-table-column label="注册状态" #default="{ row }">
-            <span :class="reportDataStatus[row.registerStatus]?.class">{{
-              reportDataStatus[row.registerStatus].label
-            }}</span>
-          </el-table-column>
-          <el-table-column label="档案号" #default="{ row }">
-            <el-tag
-              class="cursor-copy"
-              size="large"
-              v-copy:click="row.archiveId"
-              v-if="row.archiveId"
-            >
-              <span class="align-middle select-none">{{ row.archiveId }}</span>
-              <CopyDocument class="inline-block align-middle ml-2 w-4 h-4" />
-            </el-tag>
-            <span v-else>-</span>
-          </el-table-column>
-        </el-table>
-
-        <el-pagination
-          class="justify-end mt-4"
-          :current-page="state.query.page"
-          :page-size="state.query.pageSize"
-          :total="state.count"
-          background
-          layout="total, prev, pager, next, jumper"
-          @current-change="
-            page => {
-              state.query.page = page;
-              getUserList();
-            }
-          "
-        ></el-pagination>
-      </div>
-      <template #footer>
-        <div>
-          <el-button @click="dialogVisible = false">取 消</el-button>
-          <el-button
-            type="primary"
-            @click="handleSubmit"
-            :disabled="
-              state.tableData.filter(v => v.registerStatus == 1).length
-            "
-            >确认注册</el-button
-          >
-        </div>
-      </template>
-    </el-dialog>
-  </div>
-</template>
-<script lang="ts" setup>
-import {
-  ref,
-  computed,
-  defineProps,
-  defineEmits,
-  watch,
-  reactive,
-  h
-} from "vue";
-import { Search } from "@element-plus/icons-vue";
-import { request } from "@/utils";
-import { ElMessage, ElMessageBox } from "element-plus";
-import { nextTick, title } from "process";
-
-const props = defineProps({
-  show: {
-    type: Boolean,
-    default: false
-  },
-  id: {
-    type: [Number, String]
-  }
-});
-const emits = defineEmits(["update:show", "success"]);
-const dialogVisible = computed({
-  get() {
-    return props.show;
-  },
-  set(n) {
-    emits("update:show", n);
-  }
-});
-
-watch(
-  () => dialogVisible.value,
-  n => {
-    if (n) {
-      initData();
-    } else {
-    }
-  }
-);
-
-const state = reactive({
-  query: {
-    key: "",
-    value: "",
-    page: 1,
-    pageSize: 15
-  },
-  tableData: [],
-  count: 0,
-  dataCount: {},
-  multipleSelection: []
-});
-
-const keyList = [
-  {
-    key: "name",
-    name: "姓名"
-  },
-  {
-    key: "user_id",
-    name: "ID"
-  },
-  {
-    key: "mobile",
-    name: "手机号"
-  },
-  {
-    key: "id_card",
-    name: "身份证号"
-  }
-];
-const reportDataStatus = {
-  0: {
-    label: "未注册",
-    class: "text-yellow-500"
-  },
-  1: {
-    label: "注册成功",
-    class: "text-green-500"
-  },
-  2: {
-    label: "注册失败",
-    class: "text-red-500"
-  }
-};
-const multipleTableRef = ref();
-const getUserList = () => {
-  request
-    .get("/dataService/dataParse/mechanism/parsed/users", {
-      params: { ...state.query, dataId: props.id }
-    })
-    .then(resp => {
-      let responseList = resp.data.list;
-
-      state.tableData = responseList;
-      state.count = resp.data.total;
-      nextTick(() => {
-        // 默认全选
-        responseList.map(v => {
-          if (v.registerStatus != 1) {
-            multipleTableRef.value!.toggleRowSelection(v);
-          }
-        });
-      });
-    });
-};
-const getDataCount = () => {
-  request
-    .get("/dataService/dataParse/mechanism/parsed/users/count", {
-      params: { dataId: props.id }
-    })
-    .then(resp => {
-      state.dataCount = resp.data;
-    });
-};
-const handleSelectionChange = val => {
-  state.multipleSelection = val;
-};
-const handleSubmit = async () => {
-  if (!state.multipleSelection.length) {
-    return ElMessage.error("请勾选要注册的数据");
-  }
-  let excludeIds = state.tableData
-    .filter(v => !state.multipleSelection.map(v => v.id)?.includes(v.id))
-    .map(v => v.id);
-
-  await ElMessageBox.confirm(
-    `本次数据集未注册数据<span style="color: #F56C6C">${state.dataCount.notRegistered}人</span>,已选择数据<span style="color: #F56C6C">${state.multipleSelection.length}人</span>,确定无误吗`,
-    "提示",
-    {
-      dangerouslyUseHTMLString: true
-    }
-  );
-  request
-    .post("/dataService/dataParse/mechanism/parsed/register", {
-      dataId: props.id,
-      excludeIds: excludeIds
-    })
-    .then(resp => {
-      ElMessage.success(resp.message);
-      dialogVisible.value = false;
-      emits("success");
-    });
-};
-const initData = () => {
-  getUserList();
-  getDataCount();
-};
-</script>

+ 0 - 272
src/views/dataCenter/components/DialogRelevance.vue

@@ -1,272 +0,0 @@
-<template>
-  <div>
-    <el-dialog title="数据关联" v-model="dialogVisible">
-      <div>
-        <div class="flex justify-between mb-3">
-          <!-- <h3 class="flex items-center">
-            本次数据集共包含
-            <h2 style="color: #f56c6c; font-size: 30px">
-              {{ state.dataCount.total }}人
-            </h2>
-            的数据,已上报
-            <h2 style="color: #f56c6c; font-size: 30px">
-              {{ state.dataCount.reported }}人
-            </h2>
-            ,未上报
-            <h2 style="color: #f56c6c; font-size: 30px">
-              {{ state.dataCount.notReported }}人
-            </h2>
-          </h3>
-          <el-button type="primary" plain @click="getReportDataCount"
-            >刷新</el-button
-          > -->
-          <el-button
-            type="primary"
-            plain
-            @click="
-              () => {
-                getReportDataCount();
-                getUserList();
-              }
-            "
-            >刷新列表</el-button
-          >
-        </div>
-
-        <el-table :data="state.tableData" class="w-full mt-4">
-          <el-table-column prop="name" label="姓名"></el-table-column>
-          <el-table-column prop="gender" label="性别"></el-table-column>
-          <el-table-column label="检查时年龄 " prop="age"></el-table-column>
-          <el-table-column label="ID " prop="userId"></el-table-column>
-          <el-table-column label="手机号" prop="mobile"></el-table-column>
-          <el-table-column label="身份证号" prop="IDCard"></el-table-column>
-          <el-table-column label="注册状态" #default="{ row }">
-            <span :class="registerStatus[row.registerStatus]?.class">{{
-              registerStatus[row.registerStatus].label
-            }}</span>
-          </el-table-column>
-
-          <el-table-column label="数据上报状态" #default="{ row }">
-            <span :class="reportDataStatus[row.status]?.class">{{
-              reportDataStatus[row.status].label
-            }}</span>
-          </el-table-column>
-          <el-table-column label="数据批次号" prop="batchId"></el-table-column>
-          <el-table-column label="数据关联状态" #default="{ row }">
-            <span
-              v-if="!row.registerStatus && row.status == 1"
-              class="text-red-500"
-              >注册后可关联</span
-            >
-            <span
-              v-else-if="row.registerStatus != 1 && row.status != 1"
-              class="text-red-500"
-              >数据上报、注册后可关联</span
-            >
-            <span
-              v-else-if="row.registerStatus == 1 && row.status != 1"
-              class="text-red-500"
-              >数据上报后可关联</span
-            >
-            <span
-              v-else-if="
-                row.registerStatus == 1 && row.status == 1 && !row.relateStatus
-              "
-              class="text-blue-500"
-              >可关联</span
-            >
-            <span v-else>已关联</span>
-          </el-table-column>
-        </el-table>
-
-        <el-pagination
-          class="justify-end mt-4"
-          :current-page="state.query.page"
-          :page-size="state.query.pageSize"
-          :total="state.count"
-          background
-          layout="total, prev, pager, next, jumper"
-          @current-change="
-            page => {
-              state.query.page = page;
-              getUserList();
-            }
-          "
-        ></el-pagination>
-      </div>
-      <template #footer>
-        <div>
-          <div class="flex text-right justify-end">
-            <el-text>符合数据关联(数据已上报且已注册档案的数据)共</el-text>
-            <h2 style="color: #f56c6c; font-size: 30px">
-              {{ state.dataCount.canRelate || 0 }}
-            </h2>
-            <el-text>条</el-text>
-          </div>
-
-          <el-button
-            type="primary"
-            @click="handleSubmit"
-            :disabled="state.tableData.filter(v => v.relateStatus).length"
-            >确认上报</el-button
-          >
-        </div>
-      </template>
-    </el-dialog>
-  </div>
-</template>
-<script lang="ts" setup>
-import {
-  ref,
-  computed,
-  defineProps,
-  defineEmits,
-  watch,
-  reactive,
-  h
-} from "vue";
-import { Search } from "@element-plus/icons-vue";
-import { request } from "@/utils";
-import { ElMessage, ElMessageBox } from "element-plus";
-import { nextTick, title } from "process";
-
-const props = defineProps({
-  show: {
-    type: Boolean,
-    default: false
-  },
-  id: {
-    type: [Number, String]
-  }
-});
-const emits = defineEmits(["update:show", "success"]);
-const dialogVisible = computed({
-  get() {
-    return props.show;
-  },
-  set(n) {
-    emits("update:show", n);
-  }
-});
-
-watch(
-  () => dialogVisible.value,
-  n => {
-    if (n) {
-      initData();
-    } else {
-    }
-  }
-);
-
-const state = reactive({
-  query: {
-    key: "",
-    value: "",
-    page: 1,
-    pageSize: 15
-  },
-  tableData: [],
-  count: 0,
-  dataCount: {},
-  multipleSelection: []
-});
-
-const keyList = [
-  {
-    key: "name",
-    name: "姓名"
-  },
-  {
-    key: "user_id",
-    name: "ID"
-  },
-  {
-    key: "mobile",
-    name: "手机号"
-  },
-  {
-    key: "id_card",
-    name: "身份证号"
-  }
-];
-
-const registerStatus = {
-  0: {
-    label: "未注册",
-    class: "text-yellow-500"
-  },
-  1: {
-    label: "注册成功",
-    class: "text-green-500"
-  },
-  2: {
-    label: "注册失败",
-    class: "text-red-500"
-  }
-};
-const reportDataStatus = {
-  0: {
-    label: "未上报",
-    class: "text-yellow-500"
-  },
-  1: {
-    label: "上报成功",
-    class: "text-green-500"
-  },
-  2: {
-    label: "上报失败",
-    class: "text-red-500"
-  }
-};
-const multipleTableRef = ref();
-const getUserList = () => {
-  request
-    .get("/dataService/dataParse/mechanism/parsed/users", {
-      params: { ...state.query, dataId: props.id }
-    })
-    .then(resp => {
-      let responseList = resp.data.list;
-
-      state.tableData = responseList;
-      state.count = resp.data.total;
-      nextTick(() => {
-        // 默认全选
-        responseList.map(v => {
-          responseList.map(v => {
-            if (!v.status) {
-              multipleTableRef.value!.toggleRowSelection(v);
-            }
-          });
-        });
-      });
-    });
-};
-const getReportDataCount = () => {
-  request
-    .get("/dataService/dataParse/mechanism/parsed/users/count", {
-      params: { dataId: props.id }
-    })
-    .then(resp => {
-      state.dataCount = resp.data;
-    });
-};
-const handleSelectionChange = val => {
-  state.multipleSelection = val;
-};
-const handleSubmit = async () => {
-  request
-    .post("/dataService/dataParse/mechanism/parsed/relate", {
-      dataId: props.id
-    })
-    .then(resp => {
-      ElMessage.success(resp.message);
-      dialogVisible.value = false;
-      emits("success");
-    });
-};
-const initData = () => {
-  getUserList();
-  getReportDataCount();
-};
-</script>

+ 0 - 265
src/views/dataCenter/components/DialogReportData.vue

@@ -1,265 +0,0 @@
-<template>
-  <div>
-    <el-dialog title="" v-model="dialogVisible">
-      <div>
-        <div class="flex justify-between mb-3">
-          <h3 class="flex items-center">
-            本次数据集共包含
-            <h2 style="color: #f56c6c; font-size: 30px">
-              {{ state.dataCount.total }}人
-            </h2>
-            的数据,已上报
-            <h2 style="color: #f56c6c; font-size: 30px">
-              {{ state.dataCount.reported }}人
-            </h2>
-            ,未上报
-            <h2 style="color: #f56c6c; font-size: 30px">
-              {{ state.dataCount.notReported }}人
-            </h2>
-          </h3>
-          <el-button type="primary" plain @click="getReportDataCount"
-            >刷新</el-button
-          >
-        </div>
-        <div class="mt-2" style="width: 500px">
-          <el-input
-            v-model="state.query.key"
-            placeholder="请输入搜索内容"
-            class="input-with-select"
-          >
-            <template #prepend>
-              <el-select
-                v-model="state.query.type"
-                placeholder="请选择"
-                style="width: 115px"
-                clearable
-              >
-                <el-option
-                  :label="item.name"
-                  :value="item.key"
-                  v-for="item in keyList"
-                  :key="item.type"
-                />
-              </el-select>
-            </template>
-            <template #append>
-              <el-button
-                :icon="Search"
-                @click="
-                  () => {
-                    state.query.page = 1;
-                    getUserList();
-                  }
-                "
-                >搜索</el-button
-              >
-            </template>
-          </el-input>
-        </div>
-
-        <el-table
-          :data="state.tableData"
-          ref="multipleTableRef"
-          @selection-change="handleSelectionChange"
-          class="w-full mt-4"
-        >
-          <el-table-column type="selection" width="55" />
-          <el-table-column prop="name" label="姓名"></el-table-column>
-          <el-table-column prop="gender" label="性别"></el-table-column>
-          <el-table-column label="检查时年龄 " prop="age"></el-table-column>
-          <el-table-column label="ID " prop="userId"></el-table-column>
-          <el-table-column label="手机号" prop="mobile"></el-table-column>
-          <el-table-column label="身份证号" prop="IDCard"></el-table-column>
-          <el-table-column label="上报状态" #default="{ row }">
-            <span :class="reportDataStatus[row.status]?.class">{{
-              reportDataStatus[row.status].label
-            }}</span>
-          </el-table-column>
-        </el-table>
-
-        <el-pagination
-          class="justify-end mt-4"
-          :current-page="state.query.page"
-          :page-size="state.query.pageSize"
-          :total="state.count"
-          background
-          layout="total, prev, pager, next, jumper"
-          @current-change="
-            page => {
-              state.query.page = page;
-              getUserList();
-            }
-          "
-        ></el-pagination>
-      </div>
-      <template #footer>
-        <div>
-          <el-button @click="dialogVisible = false">取 消</el-button>
-          <el-button
-            type="primary"
-            @click="handleSubmit"
-            :disabled="state.tableData.filter(v => v.status).length"
-            >确认上报</el-button
-          >
-        </div>
-      </template>
-    </el-dialog>
-  </div>
-</template>
-<script lang="ts" setup>
-import {
-  ref,
-  computed,
-  defineProps,
-  defineEmits,
-  watch,
-  reactive,
-  h
-} from "vue";
-import { Search } from "@element-plus/icons-vue";
-import { request } from "@/utils";
-import { ElMessage, ElMessageBox } from "element-plus";
-import { nextTick, title } from "process";
-
-const props = defineProps({
-  show: {
-    type: Boolean,
-    default: false
-  },
-  id: {
-    type: [Number, String]
-  }
-});
-const emits = defineEmits(["update:show", "success"]);
-const dialogVisible = computed({
-  get() {
-    return props.show;
-  },
-  set(n) {
-    emits("update:show", n);
-  }
-});
-
-watch(
-  () => dialogVisible.value,
-  n => {
-    if (n) {
-      initData();
-    } else {
-    }
-  }
-);
-
-const state = reactive({
-  query: {
-    key: "",
-    value: "",
-    page: 1,
-    pageSize: 15
-  },
-  tableData: [],
-  count: 0,
-  dataCount: {},
-  multipleSelection: []
-});
-
-const keyList = [
-  {
-    key: "name",
-    name: "姓名"
-  },
-  {
-    key: "user_id",
-    name: "ID"
-  },
-  {
-    key: "mobile",
-    name: "手机号"
-  },
-  {
-    key: "id_card",
-    name: "身份证号"
-  }
-];
-const reportDataStatus = {
-  0: {
-    label: "未上报",
-    class: "text-yellow-500"
-  },
-  1: {
-    label: "上报成功",
-    class: "text-green-500"
-  },
-  2: {
-    label: "上报失败",
-    class: "text-red-500"
-  }
-};
-const multipleTableRef = ref();
-const getUserList = () => {
-  request
-    .get("/dataService/dataParse/mechanism/parsed/users", {
-      params: { ...state.query, dataId: props.id }
-    })
-    .then(resp => {
-      let responseList = resp.data.list;
-
-      state.tableData = responseList;
-      state.count = resp.data.total;
-      nextTick(() => {
-        // 默认全选
-        responseList.map(v => {
-          responseList.map(v => {
-            if (!v.status) {
-              multipleTableRef.value!.toggleRowSelection(v);
-            }
-          });
-        });
-      });
-    });
-};
-const getReportDataCount = () => {
-  request
-    .get("/dataService/dataParse/mechanism/parsed/users/count", {
-      params: { dataId: props.id }
-    })
-    .then(resp => {
-      state.dataCount = resp.data;
-    });
-};
-const handleSelectionChange = val => {
-  state.multipleSelection = val;
-};
-const handleSubmit = async () => {
-  if (!state.multipleSelection.length) {
-    return ElMessage.error("请勾选要上报的数据");
-  }
-  console.log(state.multipleSelection);
-
-  let excludeIds = state.tableData
-    .filter(v => !state.multipleSelection.map(v => v.id)?.includes(v.id))
-    .map(v => v.id);
-
-  await ElMessageBox.confirm(
-    `本次数据集未上报数据<span style="color: #F56C6C">${state.dataCount.notReported}人</span>,已选择数据<span style="color: #F56C6C">${state.multipleSelection.length}人</span>,确定无误吗`,
-    "提示",
-    {
-      dangerouslyUseHTMLString: true
-    }
-  );
-  request
-    .post("/dataService/dataParse/mechanism/parsed/report", {
-      dataId: props.id,
-      excludeIds: excludeIds
-    })
-    .then(resp => {
-      ElMessage.success(resp.message);
-      dialogVisible.value = false;
-      emits("success");
-    });
-};
-const initData = () => {
-  getUserList();
-  getReportDataCount();
-};
-</script>

+ 0 - 359
src/views/dataCenter/components/DialogViewData.vue

@@ -1,359 +0,0 @@
-<template>
-  <div>
-    <el-dialog
-      title="查看数据"
-      v-model="dialogVisible"
-      fullscreen
-      :show-close="false"
-    >
-      <template #header>
-        <div class="text-right">
-          <el-button type="danger" plain @click="dialogVisible = false"
-            >关闭</el-button
-          >
-        </div>
-      </template>
-      <el-row :gutter="30">
-        <el-col :span="8">
-          <div>
-            <div class="mb-2" style="">
-              <el-input
-                v-model="state.query.value"
-                placeholder="请输入搜索内容"
-                class="input-with-select"
-                clearable
-              >
-                <template #prepend>
-                  <el-select
-                    v-model="state.query.key"
-                    placeholder="请选择"
-                    clearable
-                    style="width: 115px"
-                  >
-                    <el-option
-                      :label="item.name"
-                      :value="item.key"
-                      v-for="item in keyList"
-                      :key="item.type"
-                    />
-                  </el-select>
-                </template>
-                <template #append>
-                  <el-button :icon="Search" @click="handleSearch"
-                    >搜索</el-button
-                  >
-                </template>
-              </el-input>
-            </div>
-            <el-table
-              :data="state.userTableData"
-              style="width: 100%"
-              @row-click="handleClickCell"
-              highlight-current-row
-            >
-              <el-table-column>
-                <template #default="{ row }">
-                  <el-text>姓名:{{ row.name }}</el-text>
-                </template>
-              </el-table-column>
-              <el-table-column>
-                <template #default="{ row }">
-                  <el-text>性别:{{ row.gender }}</el-text>
-                </template>
-              </el-table-column>
-              <el-table-column>
-                <template #default="{ row }">
-                  <el-text>检查时年龄:{{ row.age }}岁</el-text>
-                </template>
-              </el-table-column>
-              <el-table-column>
-                <template #default="{ row }">
-                  <el-text>{{ row.mergeArr.length + 1 }}项检查</el-text>
-                </template>
-              </el-table-column>
-            </el-table>
-            <el-pagination
-              class="justify-center mt-4"
-              :current-page="state.query.page"
-              :page-size="state.query.pageSize"
-              :total="state.count"
-              background
-              layout="total, prev, pager, next, jumper"
-              @current-change="
-                page => {
-                  state.query.page = page;
-                  getUserList();
-                }
-              "
-            ></el-pagination>
-          </div>
-        </el-col>
-        <el-col :span="14">
-          <div class="mb-3">
-            <el-tag
-              class="cursor-copy mr-2"
-              size="large"
-              v-copy:click="state.currentUserDetails[0]?.batchId"
-              v-if="state.currentUserDetails[0]?.status == 1"
-            >
-              <span class="align-middle select-none"
-                >数据批次号:{{ state.currentUserDetails[0].batchId }}</span
-              >
-              <CopyDocument class="inline-block align-middle ml-2 w-4 h-4" />
-            </el-tag>
-            <el-tag
-              v-if="state.currentUserDetails[0]?.registerStatus == 1"
-              class="cursor-copy"
-              size="large"
-              v-copy:click="state.currentUserDetails[0]?.archiveId || '-'"
-            >
-              <span class="align-middle select-none"
-                >关联档案号:{{
-                  state.currentUserDetails[0]?.archiveId || "-"
-                }}</span
-              >
-              <CopyDocument class="inline-block align-middle ml-2 w-4 h-4" />
-            </el-tag>
-          </div>
-          <div>
-            <div>
-              <h3 class="mb-2">用户信息</h3>
-              <el-table :data="state.currentUserDetails" border>
-                <el-table-column
-                  header-align="center"
-                  align="center"
-                  prop="姓名"
-                  label="姓名"
-                >
-                  <template #default="{ row }">
-                    <el-text>{{ row?.name }}</el-text>
-                  </template>
-                </el-table-column>
-                <el-table-column
-                  header-align="center"
-                  align="center"
-                  label="性别"
-                >
-                  <template #default="{ row }">
-                    <el-text>{{ row?.gender }}</el-text>
-                  </template>
-                </el-table-column>
-                <el-table-column
-                  header-align="center"
-                  align="center"
-                  label="检查时年龄"
-                >
-                  <template #default="{ row }">
-                    <el-text>{{ row?.age }}岁</el-text>
-                  </template>
-                </el-table-column>
-                <el-table-column
-                  header-align="center"
-                  align="center"
-                  label="ID"
-                >
-                  <template #default="{ row }">
-                    <el-text>{{ row?.userId }}</el-text>
-                  </template>
-                </el-table-column>
-                <el-table-column
-                  header-align="center"
-                  align="center"
-                  label="手机号"
-                >
-                  <template #default="{ row }">
-                    <el-text>{{ row?.mobile }}</el-text>
-                  </template>
-                </el-table-column>
-                <el-table-column
-                  header-align="center"
-                  align="center"
-                  label="身份证号"
-                >
-                  <template #default="{ row }">
-                    <el-text>{{ row?.IDCard }}</el-text>
-                  </template>
-                </el-table-column>
-              </el-table>
-            </div>
-            <div
-              v-for="(item, index) in state.currentUserDetails[0]?.mergeArr"
-              :key="index"
-            >
-              <h3 class="mb-3 mt-3">{{ item.title }}</h3>
-              <el-table :data="item.children" border>
-                <el-table-column
-                  header-align="center"
-                  align="center"
-                  prop="name"
-                  label="检查名称"
-                >
-                </el-table-column>
-                <el-table-column
-                  header-align="center"
-                  align="center"
-                  prop="value"
-                  label="检查结果"
-                >
-                </el-table-column>
-                <el-table-column
-                  header-align="center"
-                  align="center"
-                  prop="unit"
-                  label="单位 "
-                >
-                </el-table-column>
-                <el-table-column
-                  header-align="center"
-                  align="center"
-                  prop="scope"
-                  label="范围"
-                >
-                </el-table-column>
-                <el-table-column
-                  header-align="center"
-                  align="center"
-                  prop="date"
-                  label="检查日期 "
-                >
-                </el-table-column>
-              </el-table>
-            </div>
-          </div>
-        </el-col>
-      </el-row>
-    </el-dialog>
-  </div>
-</template>
-<script lang="ts" setup>
-import { request } from "@/utils";
-import { ref, computed, defineProps, defineEmits, watch, reactive } from "vue";
-import { Search } from "@element-plus/icons-vue";
-
-const props = defineProps({
-  show: {
-    type: Boolean,
-    default: false
-  },
-  id: {
-    type: [String, Number]
-  }
-});
-const emits = defineEmits(["update:show"]);
-const dialogVisible = computed({
-  get() {
-    return props.show;
-  },
-  set(n) {
-    emits("update:show", n);
-  }
-});
-
-watch(
-  () => dialogVisible.value,
-  n => {
-    if (n) {
-      initData();
-    } else {
-      onReset();
-    }
-  }
-);
-const state = reactive({
-  details: {},
-  query: {
-    key: "",
-    value: "",
-    page: 1,
-    pageSize: 15
-  },
-  count: 0,
-  userTableData: [],
-  currentUserDetails: []
-});
-const keyList = [
-  {
-    key: "name",
-    name: "姓名"
-  },
-  {
-    key: "user_id",
-    name: "ID"
-  },
-  {
-    key: "mobile",
-    name: "手机号"
-  },
-  {
-    key: "id_card",
-    name: "身份证号"
-  },
-  {
-    key: "archive_id",
-    name: "档案号"
-  },
-  {
-    key: "batch_id",
-    name: "批次号"
-  }
-];
-const getDetails = () => {};
-const handleSearch = () => {
-  state.query.page = 1;
-  getUserList();
-};
-
-const handlerDatas = arr => {
-  let obj = {};
-  arr.forEach((item, index) => {
-    let { belongTo } = item;
-    if (!obj[belongTo]) {
-      obj[belongTo] = {
-        title: belongTo,
-        children: []
-      };
-    }
-    obj[belongTo].children.push(item);
-  });
-  let data = Object.values(obj); // 最终输出
-  return data;
-};
-
-const getUserList = () => {
-  request
-    .get("/dataService/dataParse/mechanism/parsed/users", {
-      params: { ...state.query, dataId: props.id }
-    })
-    .then(resp => {
-      state.userTableData = resp?.data?.list.map(v => {
-        v.data.forEach(vv => {
-          vv["date"] = v.date;
-        });
-        v.mergeArr = handlerDatas(v.data, "belongTo");
-        return v;
-      });
-      state.count = resp.data.total;
-      if (resp.data.list.length) {
-        state.currentUserDetails = [resp.data.list[0]];
-      } else {
-        state.currentUserDetails = [];
-      }
-      console.log("state.userTableData", state.userTableData);
-    });
-};
-const handleClickCell = (row, column) => {
-  state.currentUserDetails = [row];
-};
-const initData = () => {
-  handleSearch();
-};
-const onReset = () => {
-  state.currentUserDetails = [];
-  state.query = {
-    key: "",
-    value: "",
-    page: 1,
-    pageSize: 15
-  };
-};
-</script>

+ 0 - 208
src/views/dataCenter/components/DiseaseVisitData.vue

@@ -1,208 +0,0 @@
-<template>
-  <div>
-    <slot name="form">
-      <div v-if="!transferRawJsonDiseaseId || props.formShow" class="p-4 pb-0">
-        <el-form :inline="true">
-          <el-form-item label="选择疾病" required>
-            <el-select
-              v-model="curNode"
-              filterable
-              clearable
-              :disabled="transferRawJsonDiseaseId"
-              @change="nodeChange"
-            >
-              <el-option
-                v-for="(item, index) in nodes"
-                :key="index"
-                :label="item.properties?.name"
-                :value="item.id"
-              ></el-option
-            ></el-select>
-          </el-form-item>
-          <el-form-item label="选择回访数据" required>
-            <el-select
-              v-model="formId"
-              :disabled="!curNode || transferRawJsonDiseaseId"
-              filterable
-              clearable
-              @change="formChange"
-              @clear="form = undefined"
-            >
-              <el-option
-                v-for="(item, index) in formList"
-                :key="index"
-                :label="item.properties?.name"
-                :value="item.properties?.['表单ID']"
-              ></el-option>
-            </el-select>
-          </el-form-item>
-        </el-form>
-      </div>
-    </slot>
-
-    <div
-      :class="{
-        'pt-4': transferRawJsonDiseaseId
-      }"
-    >
-      <ArchivesModule is-plat :module-id="formId" :form="form" />
-    </div>
-    <slot name="save">
-      <div class="text-right mt-4 px-4">
-        <el-button
-          v-if="form"
-          type="primary"
-          :disabled="!form && !transferRawJson.length"
-          @click="submitFormData"
-          >保存</el-button
-        >
-      </div>
-    </slot>
-  </div>
-</template>
-<script setup>
-import {
-  computed,
-  watch,
-  ref,
-  reactive,
-  onMounted,
-  shallowRef,
-  provide,
-  inject,
-  defineAsyncComponent
-} from "vue";
-
-import { useRoute, useRouter } from "vue-router";
-import {
-  CopyDocument,
-  Fold,
-  ArrowLeft,
-  ArrowRight
-} from "@element-plus/icons-vue";
-import { ElMessage } from "element-plus";
-import { request, parseJsonData, findScope } from "@/utils";
-import dayjs from "dayjs";
-
-const props = defineProps({
-  formShow: {
-    type: Boolean,
-    default: false
-  }
-});
-const ArchivesModule = defineAsyncComponent(() =>
-  import("@/views/dataCenter/components/ArchivesModule.vue")
-);
-
-const [route, router] = [useRoute(), useRouter()];
-
-const sn = inject("sn");
-const archivesId = inject("archivesId");
-const transferRawJson = inject("transferRawJson");
-const transferRawJsonFormId = inject("formId");
-const transferRawJsonDiseaseId = inject("transferRawJsonDiseaseId");
-
-const nodes = shallowRef([]);
-const searchNodes = async () => {
-  const { data } = await request.get(`/graphService/open/node/paginate`, {
-    params: {
-      page: 1,
-      pageSize: 9999,
-      tag: "可回访"
-    }
-  });
-  nodes.value = data.list;
-};
-
-const searchRelateNodes = async (id, relationship) => {
-  if (!id) return;
-  const { data } = await request.get(`/graphService/open/node/related`, {
-    params: {
-      id,
-      relationship
-    }
-  });
-  return data;
-};
-const curNode = ref("");
-const formId = ref("");
-const form = ref();
-const formList = shallowRef([]);
-const nodeChange = async v => {
-  const data = await searchRelateNodes(v, "回访表单信息");
-  formList.value = data;
-  formId.value = "";
-  form.value = undefined;
-};
-const formChange = v => {
-  if (!formId.value) return;
-  getFormDetail();
-};
-const getFormDetail = async () => {
-  const { data } = await request.get(`/formService/mechanism/form/detail`, {
-    params: {
-      id: formId.value,
-      needCheckItemId: 1
-    }
-  });
-  form.value = data.detail;
-  // getFillFormData();
-};
-const submitSimpleFormData = async (answers, close) => {
-  console.log(answers);
-  const answersNo = answers.map(v => v.answer.questionNo);
-  transferRawJson.value = [
-    ...transferRawJson.value?.filter(
-      v => !answersNo.includes(v.answer.questionNo)
-    ),
-    ...answers
-  ];
-  close && close();
-};
-provide("submitSimpleFormData", submitSimpleFormData);
-const submitFormData = async () => {
-  const req = {
-    data: {
-      formId: formId.value,
-      diseaseId: curNode.value,
-      answers: transferRawJson.value
-    },
-    sn: route.query.sn || (sn && sn.value)
-  };
-  console.log(req);
-  await request.post(
-    `/idcService/mechanism/medicalData/update/transferResult`,
-    req
-  );
-  ElMessage.success("操作成功");
-};
-
-onMounted(async () => {
-  if (!transferRawJsonDiseaseId.value) {
-    searchNodes();
-    // curNode.value = transferRawJsonDiseaseId.value;
-    // formList.value = await searchRelateNodes(
-    //   transferRawJsonDiseaseId.value,
-    //   "回访表单信息"
-    // );
-  } else {
-    curNode.value = transferRawJsonDiseaseId.value;
-    if (props.formShow) {
-      searchNodes();
-      formList.value = await searchRelateNodes(
-        transferRawJsonDiseaseId.value,
-        "回访表单信息"
-      );
-    }
-  }
-  if (transferRawJsonFormId.value) {
-    formId.value = transferRawJsonFormId.value;
-    getFormDetail();
-  }
-});
-defineExpose({
-  submitFormData
-});
-</script>
-
-<style lang="scss" scoped></style>

+ 0 - 376
src/views/dataCenter/components/DiseaseVisitDataUpload.vue

@@ -1,376 +0,0 @@
-<template>
-  <div>
-    <div class="flex items-center mb-2">
-      <span>需要上传原始数据和文件</span>
-      <el-switch v-model="needUpload"></el-switch>
-    </div>
-    <template v-if="needUpload">
-      <div
-        v-for="(item, index) in list"
-        :key="index"
-        class="rounded border border-solid border-gray-100 p-4 mb-4"
-      >
-        <div
-          class="flex justify-between items-center pb-4 mb-2 border-0 border-b border-solid border-gray-100"
-        >
-          <div>
-            <span>关联的档案号(选填):</span>
-            <SearchArchivesSelect
-              v-model="item.archivesId"
-              :disabled="!!defaultArchivesId"
-            ></SearchArchivesSelect>
-          </div>
-          <el-upload
-            :ref="r => appendUploadRefs.push(r)"
-            action="#"
-            multiple
-            :auto-upload="false"
-            :show-file-list="false"
-            :on-change="
-              (file, files) => appendFileChange(file, files, item, index)
-            "
-          >
-            <template #trigger>
-              <el-button type="primary">上传文件</el-button>
-            </template>
-          </el-upload>
-          <el-popconfirm title="是否确定删除?" @confirm="list.splice(index, 1)">
-            <template #reference>
-              <el-button type="danger" link>删除该批次</el-button>
-            </template>
-          </el-popconfirm>
-        </div>
-        <div>
-          <el-table :data="item.files">
-            <el-table-column label="文件名" prop="fileName"></el-table-column>
-            <el-table-column label="数据发生日期(必填)">
-              <template #default="{ row }">
-                <el-date-picker
-                  v-model="row.date"
-                  type="date"
-                  placeholder="请选择日期"
-                  format="YYYY-MM-DD"
-                  value-format="YYYY-MM-DD"
-                :disabled-date="disabledDate"
-                />
-              </template>
-            </el-table-column>
-            <el-table-column label="操作">
-              <template #default="{ row, $index }">
-                <el-popconfirm
-                  title="是否确定删除?"
-                  @confirm="item.files.splice($index, 1)"
-                >
-                  <template #reference>
-                    <el-button type="danger" link>删除</el-button>
-                  </template>
-                </el-popconfirm>
-              </template>
-            </el-table-column>
-          </el-table>
-        </div>
-      </div>
-      <div class="flex items-center">
-        <el-select v-model.number="uploadType">
-          <el-option label="新增单人数据" :value="0"></el-option>
-          <el-option label="新增多人数据" :value="1"></el-option>
-        </el-select>
-        <el-upload
-          ref="uploadRef"
-          v-model:file-list="uploadFiles"
-          action="#"
-          multiple
-          :auto-upload="false"
-          :show-file-list="false"
-          :on-change="uploadChange"
-        >
-          <template #trigger>
-            <el-button type="primary" class="ml-4">新增</el-button>
-          </template>
-        </el-upload>
-      </div>
-      <div>
-        <div class="my-2 text-red-500 text-xs">
-          新增单人数据时,如果上传了多份文件,那么这些文件都会放入同一个数据批次中
-        </div>
-        <div class="my-2 text-red-500 text-xs">
-          新增多人数据时,如果上传了多份文件,那么每一份文件都会创建一个独立的数据批次,您可以在每一个独立数据批次里面去追加单人的补充文件数据
-        </div>
-      </div>
-
-      <div class="text-right">
-        <el-button
-          type="primary"
-          :disabled="uploadLock || !list.length"
-          @click="createUploadTask"
-          >保存并开始上传</el-button
-        >
-      </div>
-    </template>
-    <template v-else>
-      <el-form :inline="true">
-        <el-form-item label="关联的档案号" required>
-          <SearchArchivesSelect v-model="archivesId" :disabled="!!defaultArchivesId"></SearchArchivesSelect>
-        </el-form-item>
-        <el-form-item label="选择疾病" required>
-          <el-select
-            v-model="curNode"
-            filterable
-            clearable
-            @change="nodeChange"
-          >
-            <el-option
-              v-for="(item, index) in nodes"
-              :key="index"
-              :label="item.properties?.name"
-              :value="item.id"
-            ></el-option
-          ></el-select>
-        </el-form-item>
-        <el-form-item label="选择回访数据" required>
-          <el-select
-            v-model="formId"
-            :disabled="!archivesId || !curNode"
-            filterable
-            clearable
-            @change="formChange"
-            @clear="form = undefined"
-          >
-            <el-option
-              v-for="(item, index) in formList"
-              :key="index"
-              :label="item.properties?.name"
-              :value="item.properties?.['表单ID']"
-            ></el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="选择回访日期" required>
-          <el-date-picker
-            v-model="date"
-            type="datetime"
-            placeholder="请选择日期"
-            format="YYYY-MM-DD HH:mm:ss"
-            value-format="YYYY-MM-DD HH:mm:ss"
-                :disabled-date="disabledDate"
-          />
-        </el-form-item>
-      </el-form>
-      <div>
-        <ArchivesModule is-plat :module-id="formId" :form="form" />
-      </div>
-      <div class="text-right mt-4">
-        <el-button
-          type="primary"
-          :disabled="!form && !transferRawJson.length"
-          @click="submitFormData"
-          >保存并开始上传</el-button
-        >
-      </div>
-    </template>
-  </div>
-</template>
-
-<script setup>
-import { ElMessage, ElLoading } from "element-plus";
-import { ref, inject, shallowRef, defineAsyncComponent, provide } from "vue";
-import { uploadToOSS, debounce, request, disabledDate } from "@/utils";
-import dayjs from "dayjs";
-import SearchArchivesSelect from "@/components/Archives/SearchArchivesSelect.vue";
-const ArchivesModule = defineAsyncComponent(() =>
-  import("@/views/dataCenter/components/ArchivesModule.vue")
-);
-const getDataList = inject("getList");
-const closeUploadDialog = inject("closeUploadDialog");
-const defaultArchivesId = inject("defaultArchivesId") || "";
-const list = ref([]);
-// uploadToOSS()
-
-const needUpload = ref(false);
-
-const archivesId = ref(defaultArchivesId.value || "");
-const date = ref();
-const curNode = ref("");
-const nodes = shallowRef([]);
-const searchNodes = async () => {
-  const { data } = await request.get(`/graphService/open/node/paginate`, {
-    params: {
-      page: 1,
-      pageSize: 9999,
-      tag: "可回访"
-    }
-  });
-  nodes.value = data.list;
-};
-searchNodes();
-
-const searchRelateNodes = async (id, relationship) => {
-  if (!id) return;
-  const { data } = await request.get(`/graphService/open/node/related`, {
-    params: {
-      id,
-      relationship
-    }
-  });
-  return data;
-};
-const formId = ref("");
-const form = ref();
-const formList = shallowRef([]);
-const transferRawJson = ref([]);
-provide("transferRawJson", transferRawJson);
-const nodeChange = async v => {
-  const data = await searchRelateNodes(v, "回访表单信息");
-  formList.value = data;
-  formId.value = "";
-  form.value = undefined;
-};
-const formChange = v => {
-  if (!formId.value) return;
-  getFormDetail();
-};
-const getFormDetail = async () => {
-  const { data } = await request.get(`/archivesService/mechanism/form/detail`, {
-    params: {
-      archivesId: archivesId.value,
-      formId: formId.value,
-      needCheckItemId: 1,
-      isOpen: 1
-    }
-  });
-  form.value = data.detail;
-  // getFillFormData();
-};
-const submitSimpleFormData = async (answers, close) => {
-  console.log(answers);
-  const answersNo = answers.map(v => v.answer.questionNo);
-  transferRawJson.value = [
-    ...transferRawJson.value?.filter(
-      v => !answersNo.includes(v.answer.questionNo)
-    ),
-    ...answers
-  ];
-  close && close();
-};
-provide("submitSimpleFormData", submitSimpleFormData);
-const submitFormData = async () => {
-  const req = {
-    transferRawJson: JSON.stringify({
-      formId: formId.value,
-      diseaseId: curNode.value,
-      answers: transferRawJson.value
-    }),
-    type: 3,
-    archivesId: archivesId.value,
-    date: dayjs(Date.now()).format("YYYY-MM-DD HH:mm:ss")
-  };
-  console.log(req);
-  await request.post(`/medicalData/create`, req);
-  ElMessage.success("操作成功");
-  closeUploadDialog();
-  getDataList();
-};
-
-const uploadType = ref(0);
-const uploadRef = ref();
-const uploadFiles = ref([]);
-const uploadChange = debounce((file, files) => {
-  console.log(uploadFiles.value, file, files);
-  if (uploadType.value) {
-    files.forEach(f => {
-      list.value.push({
-        type: uploadType.value,
-        archivesId: archivesId.value,
-        files: [
-          {
-            raw: f.raw,
-            fileName: f.name,
-            date: "",
-            fileUrl: "",
-            remark: ""
-          }
-        ]
-      });
-    });
-  } else {
-    list.value.push({
-      type: uploadType.value,
-      files: files.map(f => ({
-        raw: f.raw,
-        fileName: f.name,
-        date: "",
-        fileUrl: "",
-        remark: ""
-      })),
-      archivesId: archivesId.value
-    });
-  }
-  uploadRef.value.clearFiles();
-}, 1e2);
-const appendUploadRefs = ref([]);
-const appendFileChange = debounce((file, files, item, index) => {
-  console.log(files, item);
-  console.log(appendUploadRefs.value[index]);
-  files.forEach(f => {
-    item.files.push({
-      raw: f.raw,
-      fileName: f.name,
-      date: "",
-      fileUrl: "",
-      remark: ""
-    });
-  });
-  appendUploadRefs.value.forEach(v => {
-    v.clearFiles && v.clearFiles();
-  });
-}, 1e2);
-
-const uploadLock = ref(false);
-const createUploadTask = async () => {
-  uploadLock.value = true;
-
-  const uploadFileTotal = list.value.reduce((a, b) => a + b.files.length, 0);
-  console.log(uploadFileTotal);
-  if (!uploadFileTotal) return ElMessage.error("请新增数据后保存");
-  if (
-    uploadFileTotal !=
-    list.value
-      .map(v => v.files.map(f => f.date))
-      .flat()
-      .filter(v => v).length
-  ) {
-    uploadLock.value = false;
-    return ElMessage.error("请填写所有文件的发生日期");
-  }
-  const loading = ElLoading.service({
-    lock: true,
-    text: "开始上传",
-    background: "rgba(255, 255, 255, 0.7)"
-  });
-  try {
-    let uploadCount = 0;
-    for (const item of list.value) {
-      for (const v of item.files) {
-        v.fileUrl = await uploadToOSS(v.raw, v.fileName);
-        uploadCount++;
-        loading.text = `正在上传文件${uploadCount}/${uploadFileTotal}`;
-      }
-    }
-
-    loading.text = `批次处理中`;
-    await Promise.all(
-      list.value.map(item => {
-        return request.post(`/medicalData/create`, { ...item, type: 3 });
-      })
-    );
-    ElMessage.success("创建完成");
-    getDataList();
-    closeUploadDialog();
-  } catch (e) {
-    console.log(e);
-  }
-  uploadLock.value = false;
-  loading.close();
-};
-</script>
-
-<style lang="scss" scoped></style>

+ 0 - 92
src/views/dataCenter/components/EditArchivesModule.vue

@@ -1,92 +0,0 @@
-<template>
-  <div class="page-edit-healthy-file">
-    <div v-if="archivesModule">
-      <EditQuestionTemplate :indicator="archivesModule" :archives-id="props.id" :is-plat="props.isPlat" @close="f => emits('close', f)"/>
-    </div>
-  </div>
-</template>
-
-<script setup >
-import { useRoute, useRouter } from "vue-router";
-import { ref, watch, onMounted } from 'vue';
-import EditQuestionTemplate from './EditQuestionTemplate.vue';
-import { deepClone, parseJSON } from '@/utils';
-import { ElMessage } from 'element-plus';
-const route = useRoute()
-const router = useRouter()
-const props = defineProps({
-  isPlat: {
-    type: Boolean,
-    default: false
-  },
-  id: {
-    type: String,
-    default: ''
-  },
-  moduleId: {
-    type: String,
-    default: undefined
-  },
-  indicator: {
-    type: Object,
-    default: undefined
-  }
-})
-const emits = defineEmits(['close'])
-const archivesModule = ref()
-watch(() => props.indicator, () => {
-  archivesModule.value = deepClone(props.indicator)
-})
-
-const init = async () => {
-  if (props.isPlat) {
-    archivesModule.value = deepClone(props.indicator)
-  } else {
-    const indicator = healthyFile.editArchivesItem
-    const { moduleId } = route.query
-    console.log(moduleId, indicator);
-    archivesModule.value = indicator
-  }
-}
-
-onMounted(init)
-</script>
-<style lang="scss">
-.page-edit-healthy-file {
-  padding: 15px 0 110px;
-  .checkbox-list {
-    .checkbox-item {
-      margin: 0 10px 10px 0;
-      padding: 4px 10px;
-      height: auto;
-    }
-    .el-button+.el-button {
-      margin-left: 0;
-    }
-  }
-  .survey-matrix-container {
-    overflow-x: auto;
-    padding: 10px 0;
-    .survey-matrix {
-      font-size: 12px;
-      border-collapse: collapse;
-      margin: 0 auto;
-      min-width: 100%;
-      th, td {
-        border: 1px solid #ccc;
-        padding: 10px;
-        text-align: center;
-      }
-      th {
-        white-space: nowrap;
-      }
-      tr {
-        td:first-of-type {
-          font-weight: blod;
-          white-space: nowrap;
-        }
-      }
-    }
-  }
-}
-</style>

+ 0 - 545
src/views/dataCenter/components/EditQuestionTemplate.vue

@@ -1,545 +0,0 @@
-<template>
-  <div>
-    <div
-      v-for="(item, index) in showList || []"
-      :key="index"
-      class="mx-4 mb-4 rounded-lg bg-white edit-healthy-file-item"
-      :class="{
-        'px-4': !props.isPlat,
-        hidden: item.isHidden
-      }"
-    >
-      <QuestionItem
-        v-model:info="showList[index]"
-        @checkMatrix="checkMatrix"
-        @reply="reply"
-      >
-        <div class="px-4 my-2 text-right">
-          <el-button
-            v-if="item.isRepeat && item.showDelete"
-            plain
-            round
-            size="small"
-            type="danger"
-            @click="repeatDelete(item, index)"
-            >删除</el-button
-          >
-          <el-button
-            v-if="item.isRepeat && item.showAdd"
-            plain
-            round
-            size="small"
-            type="primary"
-            @click="repeat(item, index)"
-            >新增</el-button
-          >
-        </div>
-      </QuestionItem>
-    </div>
-    <div v-if="!props.isPlat" class="px-4">
-      <el-button class="w-full" size="large" type="primary" @click="save"
-        >保存并返回</el-button
-      >
-    </div>
-    <div v-else>
-      <el-button class="w-full" size="large" type="primary" @click="save"
-        >保存</el-button
-      >
-    </div>
-  </div>
-</template>
-<script lang="ts" setup>
-import { computed, reactive, ref, inject, onMounted, nextTick } from "vue";
-import QuestionItem from "./QuestionItem.vue";
-import {
-  parseJSON,
-  request,
-  deepClone,
-  formatHistory,
-  formatValidator,
-  formatResultList,
-  formatItemVal,
-  formatData,
-  formatQuKey
-} from "@/utils";
-import { useRoute, useRouter } from "vue-router";
-import { ElMessage } from "element-plus";
-import * as question from "@/enums/question";
-const route = useRoute();
-const router = useRouter();
-const props = defineProps({
-  isPlat: {
-    type: Boolean,
-    default: false
-  },
-  indicator: {
-    type: Object
-  }
-});
-
-const emits = defineEmits(["update:value", "close"]);
-
-const item = computed({
-  get() {
-    return props.indicator;
-  },
-  set(value) {
-    emits("update:value", value);
-  }
-});
-
-const rules = ref<any>({});
-
-const state = reactive({
-  detail: {
-    key: "",
-    validator: [] as any[],
-    peg: {
-      rules: {} as any,
-      raw: ""
-    },
-    indicatorName: "",
-    label: "",
-    value: [] as any[],
-    rawValue: [] as any[]
-  }
-});
-const rawList = ref<any[]>([]);
-const showList = ref<any[]>([]);
-const testList = ref<any[]>([]);
-const hideList = ref<any[]>([]);
-const updateShowList = () => {
-  showList.value = rawList.value.filter(
-    (v: any) => !hideList.value.includes(v.sn)
-  );
-};
-const reply = (item: any) => {
-  console.log(item.type, item.attr, item, rules.value);
-  // state.detail.value[getIdx(item.combination || item.attr)] =
-  formatItemVal(item);
-
-  const rule = rules.value[`QU${item.sn}`];
-  console.log(rule);
-
-  if (rule) {
-    console.log(rule);
-    console.log("规则执行");
-    console.log("==================start=====================");
-    let to: string | undefined = undefined;
-    try {
-      for (const i in rule || []) {
-        console.log("执行规则", i + 1, "-----type:", rule[i].type);
-        const res: any = formatRule(rule[i]) || {};
-        switch (res.type) {
-          case "show":
-            console.log("show", res.target);
-            hideList.value = hideList.value.filter(
-              (v: string) => v != formatQuKey(res.target)
-            );
-            updateShowList();
-            break;
-          case "hide":
-            console.log("hide", res.target);
-            hideList.value.push(formatQuKey(res.target));
-            updateShowList();
-            break;
-          case "to":
-            to = res.to || undefined;
-            break;
-          case "say":
-            // res.say && await pushText(res.say || '', 0, true)
-            break;
-          case "end":
-            // state.replyLock = false
-            return;
-        }
-      }
-    } catch (e: any) {
-      console.log("报错了");
-      console.log(e);
-      ElMessage.error(e?.message);
-    }
-  }
-};
-const archivesModule = ref<any>();
-const init = async () => {
-  console.log("props.indicator");
-  console.log(props.indicator);
-  archivesModule.value = deepClone(props.indicator);
-  // document.title = "健康档案-" + archivesModule.value.name;
-  archivesModule.value.extra.subjects = (
-    archivesModule.value.extra?.subjects
-      ? archivesModule.value.extra.subjects
-      : [archivesModule.value.extra]
-  )?.map((subject: any) => {
-    const temp = {
-      ...subject,
-      ...parseJSON(subject.validator, {})
-    };
-    delete temp.validate;
-    return temp;
-  });
-  // archivesModule.value.subjects =
-  console.log(archivesModule.value.extra.subjects);
-
-  rawList.value = formatValidator(archivesModule.value.extra.subjects || []);
-  console.log("rawList", rawList.value);
-
-  // const historyAnswer = parseJSON(archivesModule.value.archivesIndicator.extraTemplateRawValue)
-  formatHistory(1, rawList);
-  console.log("historyAnswer", rawList.value);
-  const rule = parseJSON(archivesModule.value.extra?.peg)?.rules || {};
-  console.log("rule", rule);
-  rules.value = rule;
-  rawList.value.forEach(reply);
-  updateShowList();
-};
-
-onMounted(init);
-// 矩阵题选择
-const checkMatrix = (item: any, rowIdx: number, colIdx: number) => {
-  console.log(item);
-
-  const curState = item.matrix[rowIdx][colIdx];
-  const isMultiple = item.isMultiple;
-  const mutuallyExclusive = item.columns[colIdx].mutuallyExclusive;
-  // 单选
-  if (!isMultiple) {
-    item.matrix[rowIdx].forEach((v: any, k: number) => {
-      item.matrix[rowIdx][k] = k === colIdx ? !curState : false;
-    });
-  } else {
-    // 多选
-    // 该列有互斥
-    if (mutuallyExclusive) {
-      if (curState) {
-        item.matrix[rowIdx][colIdx] = !curState;
-      } else {
-        item.matrix[rowIdx].forEach((v: any, k: number) => {
-          item.matrix[rowIdx][k] = k === colIdx;
-        });
-      }
-    } else {
-      item.matrix[rowIdx].forEach((v: any, k: number) => {
-        if (item.columns[k].mutuallyExclusive) {
-          item.matrix[rowIdx][k] = false;
-        }
-      });
-      item.matrix[rowIdx][colIdx] = !item.matrix[rowIdx][colIdx];
-    }
-  }
-  const res: string[] = [];
-  item.matrix?.forEach((cols: boolean[], k1: number) => {
-    cols &&
-      cols.forEach &&
-      cols?.forEach((c: boolean, k2: number) => {
-        c && res.push(item.rows[k1].label + "" + item.columns[k2].label);
-      });
-  });
-  item.value = res;
-};
-const getRuleKey = (type: string) => {
-  switch (type) {
-    case "showHide":
-    case "to":
-      return "expression";
-    case "say":
-    case "replace":
-      return "keyword";
-    default:
-      return "";
-  }
-};
-
-const getItem = (code: string) => {
-  code = code.replace(/^QU/, "");
-  return rawList.value.find((v: any) => v.sn === code);
-};
-const getQ = (code: string) => {
-  code = code.replace(/^QU/, "");
-  const items = showList.value.filter((v: any) => v.sn === code);
-  const item = getItem(code);
-  console.log(showList.value);
-  console.log(items);
-  if (items.length > 1) {
-    return items.map(formatItemVal);
-  }
-  const val = item.value;
-
-  if (item.type === question.QUESTION_TYPE_RADIO) {
-    return [val];
-  } else if (item.type === question.QUESTION_TYPE_CHECKBOX) {
-    return val || [];
-  }
-  return item.value;
-};
-const getVal = (code: string) => {
-  return getQ(code);
-};
-const formatAge = (birthday: string) => {
-  if (!birthday) return "";
-  if (!isNaN(Number(birthday))) return birthday;
-  const offset = +new Date() - +new Date(birthday.replace(/-/g, "/"));
-  return parseInt(String(offset / 86400000 / 365));
-};
-const chooseAnd = (itemVal: number[], ...choices: number[]) => {
-  for (const idx of choices) {
-    if (!itemVal.includes(idx)) return false;
-  }
-  return true;
-};
-const chooseOr = (itemVal: number[], ...choices: number[]) => {
-  for (const idx of choices) {
-    if (itemVal.includes(idx)) return true;
-  }
-  return false;
-};
-const chooseMatrix = (itemVal: string[], ...values: string[]) => {
-  for (const v of values) {
-    if (!itemVal.includes(v)) return false;
-  }
-  return true;
-};
-const chooseMatrixOr = (itemVal: string[], ...values: string[]) => {
-  for (const v of values) {
-    if (!itemVal.includes(v)) return true;
-  }
-  return false;
-};
-const isEmpty = (val: any) => {
-  if (Array.isArray(val)) {
-    return !val.length;
-  }
-  if (val === 0) return false;
-  return !val;
-};
-const count = (arg: any[] | string) =>
-  typeof arg == "number" ? arg : arg.length;
-const customFunc = [
-  "formatAge",
-  "chooseAnd",
-  "chooseOr",
-  "chooseMatrix",
-  "chooseMatrixOr",
-  "isEmpty",
-  "count"
-];
-[
-  formatAge,
-  chooseAnd,
-  chooseOr,
-  chooseMatrix,
-  chooseMatrixOr,
-  isEmpty,
-  count
-].forEach((fn, i) => {
-  window[customFunc[i]] = fn;
-});
-const formatRule = (rule: any) => {
-  const getQAReg = new RegExp(/QU(\w+)?/gi);
-  let rawCondition = rule[getRuleKey(rule.type)] || "";
-  rawCondition = rawCondition
-    .replace(/ and /g, " && ")
-    .replace(/ or /g, " || ");
-
-  let condition = rawCondition;
-  let replaceReg: RegExp | undefined = undefined;
-  let qa = [];
-  if (condition) {
-    console.log(
-      `%c当前的规则: ${condition}`,
-      "font-size: 16px; color: #4b72f6;"
-    );
-    qa = rawCondition.match(getQAReg) || [];
-    console.log("qa:", qa.join(","));
-    qa.map((n: string) => {
-      const code = formatQuKey(n);
-      const curItem = getItem(code);
-      const v = getVal(code);
-      console.log(`当前拿到的值`, v);
-      for (const func of customFunc) {
-        if (condition.includes(func)) {
-          // 选择类方法
-          if (/^choose/.test(func)) {
-            if (func.includes("Matrix")) {
-              curItem.rows.forEach((row: any) => {
-                curItem.columns.forEach((col: any) => {
-                  const matrixAttr = row.attr + col.attr;
-                  if (condition.includes(matrixAttr)) {
-                    condition = condition.replace(
-                      new RegExp(matrixAttr),
-                      `"${row.label + col.label}"`
-                    );
-                  }
-                });
-              });
-            } else {
-              let sortChoices = curItem.choices.map((v: any, k: number) => {
-                return {
-                  ...v,
-                  index: k
-                };
-              });
-              sortChoices = sortChoices.sort(
-                (a: any, b: any) => b.attr.length - a.attr.length
-              );
-              sortChoices.forEach((v: any) => {
-                if (condition.includes(v.attr)) {
-                  condition = condition.replace(new RegExp(v.attr), v.index);
-                }
-              });
-            }
-          }
-        }
-      }
-      const reg = new RegExp(n);
-      console.log(`要执行的正则`, reg, v);
-      condition = condition.replace(
-        reg,
-        Array.isArray(v)
-          ? `[${v
-              .map(v2 => (typeof v2 === "string" ? `'${v2}'` : v2))
-              .join(",")}]`
-          : typeof v === "string"
-          ? `'${v}'`
-          : v
-      );
-      console.log(condition);
-    });
-
-    console.log(`获取到的qa`, qa);
-    console.log(`最后的condition`, condition);
-  }
-  let flag = false;
-  try {
-    flag = eval(condition);
-  } catch (e) {
-    flag = false;
-  }
-  console.log(`当前规则执行的flag: %c ${flag}`, "color: #f00;");
-
-  // eslint-disable-next-line no-case-declarations
-  switch (rule.type) {
-    case "showHide":
-      console.log(`执行---------------show hide -----------规则: ${condition}`);
-      if (rule.method == "show") {
-        return {
-          type: flag ? "show" : "hide",
-          target: rule.question
-        };
-      } else {
-        return {
-          type: !flag ? "show" : "hide",
-          target: rule.question
-        };
-      }
-    case "to":
-      console.log(`执行---------------to-----------规则: ${condition}`);
-      return flag
-        ? {
-            type: "to",
-            to: rule.to
-          }
-        : undefined;
-    case "say":
-      console.log(`执行---------------say-----------规则: ${condition}`);
-      // flag && pushText(rule.say)
-      if (flag) {
-        return {
-          type: "say",
-          say: rule.say
-        };
-      }
-      break;
-
-    case "replace":
-      console.log(`执行---------------replace-----------规则: ${condition}`);
-      replaceReg = new RegExp(rule.keyword);
-      console.log(`执行正则: ${rule.keyword}`);
-
-      {
-        let t = undefined;
-        //  存在index时
-        const q = getItem(rule.from);
-        console.log(`当前replace-q: `);
-        console.log(q);
-        if (rule.index >= 0) {
-          console.log(q["choices"][rule.index - 1]);
-          t = q["choices"][rule.index - 1]?.label;
-        } else {
-          if (q["choices"]) {
-            t = q["choices"][Number(getItem(rule.from))].label;
-          } else {
-            t = q.value;
-          }
-        }
-        console.log(`获取到的t: ${t}`);
-
-        getItem(rule.to).title = getItem(rule.to).title?.replace(
-          replaceReg,
-          Array.isArray(t) ? t.join(",") : t
-        );
-      }
-      break;
-    case "end":
-      return {
-        type: "end"
-      };
-  }
-};
-
-const repeat = (item: any, idx: number) => {
-  console.log("repeat", item);
-  const showDelete = showList.value.filter(
-    (v: any) => v.attr === item.attr
-  ).length;
-  showList.value.forEach((v: any) => {
-    if (v.attr === item.attr) {
-      v.showDelete = showDelete;
-      v.showAdd = false;
-    }
-  });
-  nextTick(() => {
-    const item = JSON.parse(JSON.stringify(showList.value.at(idx)));
-    if (item.type === "group" || item.type === "combination") {
-      item.children = item.children.map((v: any) => {
-        v.value = Array.isArray(v.value) ? [] : "";
-        return v;
-      });
-    }
-    showList.value.splice(idx + 1, 0, {
-      ...item,
-      showDelete,
-      isAnswered: false,
-      showAdd: true,
-      value: ""
-    });
-  });
-};
-const repeatDelete = (item: any, idx: number) => {
-  showList.value.splice(idx, 1);
-  const showDelete =
-    showList.value.filter((v: any) => v.attr === item.attr).length > 1;
-  if (item.showAdd && showList.value[idx - 1]) {
-    showList.value[idx - 1].showAdd = true;
-  }
-  showList.value.forEach((v: any) => {
-    if (v.attr === item.attr) {
-      v.showDelete = !!showDelete;
-    }
-  });
-};
-const close = () => {
-  emits("close");
-};
-const submitSimpleFormData = inject("submitSimpleFormData") as Function;
-const save = async () => {
-  console.log("showList", showList.value);
-  const list: any[] = formatResultList(showList.value);
-  console.log(list);
-  const answers = formatData(list, props.indicator);
-  console.log("answers", answers);
-  submitSimpleFormData && submitSimpleFormData(answers, close);
-};
-</script>
-<style lang="scss"></style>

+ 0 - 278
src/views/dataCenter/components/MedicalReportUpload.vue

@@ -1,278 +0,0 @@
-<template>
-  <div>
-    <div
-      v-for="(item, index) in list"
-      :key="index"
-      class="rounded border border-solid border-gray-100 p-4 mb-4"
-    >
-      <div
-        class="flex justify-between items-center pb-4 mb-2 border-0 border-b border-solid border-gray-100"
-      >
-        <div class="flex items-center">
-          <span
-            >关联的档案号{{ isOpenWallet ? "(必填)" : "(选填)" }}:</span
-          >
-          <SearchArchivesSelect
-            v-model="item.archivesId"
-            :disabled="!!defaultArchivesId"
-            @change="archivesSelectChange"
-          ></SearchArchivesSelect>
-          <el-alert
-            v-if="
-              archivesBalanceFlag[item.archivesId] !== undefined &&
-              !archivesBalanceFlag[item.archivesId]
-            "
-            title="该用户余额不足,无法关联"
-            type="warning"
-            class="w-fit ml-2"
-            show-icon
-            :closable="false"
-          />
-        </div>
-        <el-upload
-          :ref="r => appendUploadRefs.push(r)"
-          action="#"
-          multiple
-          :auto-upload="false"
-          :show-file-list="false"
-          :on-change="
-            (file, files) => appendFileChange(file, files, item, index)
-          "
-        >
-          <template #trigger>
-            <el-button type="primary">上传文件</el-button>
-          </template>
-        </el-upload>
-        <el-popconfirm title="是否确定删除?" @confirm="list.splice(index, 1)">
-          <template #reference>
-            <el-button type="danger" link>删除该批次</el-button>
-          </template>
-        </el-popconfirm>
-      </div>
-      <div>
-        <el-table :data="item.files">
-          <el-table-column label="文件名" prop="fileName"></el-table-column>
-          <el-table-column label="数据发生日期(必填)">
-            <template #default="{ row }">
-              <el-date-picker
-                v-model="row.date"
-                type="date"
-                placeholder="请选择日期"
-                format="YYYY-MM-DD"
-                value-format="YYYY-MM-DD"
-                :disabled-date="disabledDate"
-              />
-            </template>
-          </el-table-column>
-          <el-table-column label="操作">
-            <template #default="{ row, $index }">
-              <el-popconfirm
-                title="是否确定删除?"
-                @confirm="item.files.splice($index, 1)"
-              >
-                <template #reference>
-                  <el-button type="danger" link>删除</el-button>
-                </template>
-              </el-popconfirm>
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-    </div>
-    <div class="flex items-center">
-      <el-select v-model.number="uploadType">
-        <el-option label="新增单人数据" :value="0"></el-option>
-        <el-option label="新增多人数据" :value="1"></el-option>
-      </el-select>
-      <el-upload
-        ref="uploadRef"
-        v-model:file-list="uploadFiles"
-        action="#"
-        multiple
-        :auto-upload="false"
-        :show-file-list="false"
-        :on-change="uploadChange"
-      >
-        <template #trigger>
-          <el-button type="primary" class="ml-4">新增</el-button>
-        </template>
-      </el-upload>
-    </div>
-    <div>
-      <div class="my-2 text-red-500 text-xs">
-        新增单人数据时,如果上传了多份文件,那么这些文件都会放入同一个数据批次中
-      </div>
-      <div class="my-2 text-red-500 text-xs">
-        新增多人数据时,如果上传了多份文件,那么每一份文件都会创建一个独立的数据批次,您可以在每一个独立数据批次里面去追加单人的补充文件数据
-      </div>
-    </div>
-    <div class="text-right">
-      <el-button
-        type="primary"
-        :disabled="
-          uploadLock ||
-          !list.length ||
-          (isOpenWallet &&
-            list.map(v => v.archivesId).filter(v => v).length != list.length)
-        "
-        @click="createUploadTask"
-        >保存并开始上传</el-button
-      >
-    </div>
-  </div>
-</template>
-
-<script setup>
-import { ElMessage, ElLoading } from "element-plus";
-import { ref, inject } from "vue";
-import { uploadToOSS, debounce, request, disabledDate } from "@/utils";
-
-import SearchArchivesSelect from "@/components/Archives/SearchArchivesSelect.vue";
-
-import { useUserStoreHook } from "@/store/modules/user";
-const mechanismId = useUserStoreHook()?.profile.id;
-const defaultArchivesId = inject("defaultArchivesId") || "";
-const getDataList = inject("getList");
-const closeUploadDialog = inject("closeUploadDialog");
-const list = ref([]);
-// uploadToOSS()
-const uploadType = ref(0);
-const uploadRef = ref();
-const uploadFiles = ref([]);
-const uploadChange = debounce((file, files) => {
-  console.log(uploadFiles.value, file, files);
-  if (uploadType.value) {
-    files.forEach(f => {
-      list.value.push({
-        type: uploadType.value,
-        archivesId: defaultArchivesId.value || "",
-        files: [
-          {
-            raw: f.raw,
-            fileName: f.name,
-            date: "",
-            fileUrl: "",
-            remark: ""
-          }
-        ]
-      });
-    });
-  } else {
-    list.value.push({
-      type: uploadType.value,
-      files: files.map(f => ({
-        raw: f.raw,
-        fileName: f.name,
-        date: "",
-        fileUrl: "",
-        remark: ""
-      })),
-      archivesId: defaultArchivesId.value || ""
-    });
-  }
-  uploadRef.value.clearFiles();
-}, 1e2);
-const appendUploadRefs = ref([]);
-const appendFileChange = debounce((file, files, item, index) => {
-  console.log(files, item);
-  console.log(appendUploadRefs.value[index]);
-  files.forEach(f => {
-    item.files.push({
-      raw: f.raw,
-      fileName: f.name,
-      date: "",
-      fileUrl: "",
-      remark: ""
-    });
-  });
-  appendUploadRefs.value.forEach(v => {
-    v.clearFiles && v.clearFiles();
-  });
-}, 1e2);
-
-const uploadLock = ref(false);
-const createUploadTask = async () => {
-  uploadLock.value = true;
-
-  const uploadFileTotal = list.value.reduce((a, b) => a + b.files.length, 0);
-  console.log(uploadFileTotal);
-  if (!uploadFileTotal) return ElMessage.error("请新增数据后保存");
-  if (
-    uploadFileTotal !=
-    list.value
-      .map(v => v.files.map(f => f.date))
-      .flat()
-      .filter(v => v).length
-  ) {
-    uploadLock.value = false;
-    return ElMessage.error("请填写所有文件的发生日期");
-  }
-  const loading = ElLoading.service({
-    lock: true,
-    text: "开始上传",
-    background: "rgba(255, 255, 255, 0.7)"
-  });
-  try {
-    let uploadCount = 0;
-    for (const item of list.value) {
-      for (const v of item.files) {
-        v.fileUrl = await uploadToOSS(v.raw, v.fileName);
-        uploadCount++;
-        loading.text = `正在上传文件${uploadCount}/${uploadFileTotal}`;
-      }
-    }
-
-    loading.text = `批次处理中`;
-    await Promise.all(
-      list.value.map(item => {
-        return request.post(`/medicalData/create`, { ...item, type: 1 });
-      })
-    );
-    ElMessage.success("创建完成");
-    getDataList();
-    closeUploadDialog();
-  } catch (e) {
-    console.log(e);
-  }
-  uploadLock.value = false;
-  loading.close();
-};
-const isOpenWallet = ref(false);
-const checkMechanismWallet = async () => {
-  const { data } = await request.get(
-    "/walletService//openapi/walletType/mechanism",
-    {
-      params: {
-        walletTypeId: 1,
-        mechanismId
-      }
-    }
-  );
-  isOpenWallet.value = !!data;
-};
-checkMechanismWallet();
-const checkBalance = async archiveSn => {
-  if (!isOpenWallet.value) return true;
-  const { data } = await request.get(
-    `/walletService/mechanism/user/wallet/balance`,
-    {
-      params: {
-        archiveSn,
-        walletTypeId: 1
-      }
-    }
-  );
-  if (data.balanceType == -1) return true;
-  return data.balance > 0;
-};
-const archivesBalanceFlag = ref({});
-const archivesSelectChange = async (archivesId, archives) => {
-  console.log(archives);
-  archivesBalanceFlag.value[archivesId] = true;
-  archivesBalanceFlag.value[archivesId] = await checkBalance(
-    archives.mainArchivesId || archives.id
-  );
-};
-</script>
-
-<style lang="scss" scoped></style>

+ 0 - 144
src/views/dataCenter/components/MonitoringData.vue

@@ -1,144 +0,0 @@
-<template>
-  <div>
-    <div v-if="transferRawJson[0]" class="p-2">
-
-      <el-table :data="transferRawJson[0]?.bodyData">
-        <el-table-column label="项目名称" prop="name"></el-table-column>
-        <el-table-column label="检查结果">
-          <template #default="{ row }">
-            <el-input
-              v-if="editMonitoring"
-              v-model="row.value"
-              placeholder="请输入"
-            ></el-input>
-            <span v-else>{{ row.value }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="参考范围">
-          <template #default="{ row }">
-            <el-input
-              v-if="editMonitoring"
-              v-model="row.reference"
-              placeholder="请输入"
-            ></el-input>
-            <span v-else>{{ row.reference }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="单位">
-          <template #default="{ row }">
-            <el-input
-              v-if="editMonitoring"
-              v-model="row.unit"
-              placeholder="请输入"
-            ></el-input>
-            <span v-else>{{ row.unit }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="检测时间">
-          <template #default="{ row }">
-            <el-date-picker
-              v-if="editMonitoring"
-              v-model="row.date"
-              type="datetime"
-              placeholder="请选择日期"
-              format="YYYY-MM-DD HH:mm:ss"
-              value-format="YYYY-MM-DD HH:mm:ss"
-            />
-            <span v-else>{{
-              dayjs(row.date).format("YYYY-MM-DD HH:mm:ss")
-            }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column v-if="editMonitoring" label="操作">
-          <template #default="{ row, $index }">
-            <el-popconfirm
-              title="是否确定删除?"
-              @confirm="list.splice($index, 1)"
-            >
-              <template #reference>
-                <el-button type="danger" link>删除</el-button>
-              </template>
-            </el-popconfirm>
-          </template>
-        </el-table-column>
-      </el-table>
-      <div class="text-right mt-4">
-        <el-button
-          v-if="!editMonitoring"
-          type="primary"
-          plain
-          @click="editMonitoring = true"
-          >修改数据</el-button
-        >
-        <el-button v-else type="primary" @click="saveMonitoring"
-          >保存</el-button
-        >
-      </div>
-    </div>
-  </div>
-</template>
-
-<script setup>
-import {
-  computed,
-  watch,
-  ref,
-  reactive,
-  onMounted,
-  shallowRef,
-  provide,
-  inject,
-  defineAsyncComponent
-} from "vue";
-
-import { useRoute, useRouter } from "vue-router";
-import {
-  CopyDocument,
-  Fold,
-  ArrowLeft,
-  ArrowRight
-} from "@element-plus/icons-vue";
-import { ElMessage } from "element-plus";
-import { request, parseJsonData, findScope } from "@/utils";
-import dayjs from "dayjs";
-
-const [route, router] = [useRoute(), useRouter()];
-
-const getDetail = inject("getDetail");
-const transferRawJson = inject("transferRawJson");
-
-const editMonitoring = ref(false);
-const saveMonitoring = async () => {
-  for (const item of transferRawJson.value[0]?.bodyData) {
-    if ((!item.value && item.value !== 0) || !item.date) {
-      return ElMessage.error("请填写必填项");
-    }
-  }
-  console.log(transferRawJson.value);
-  transferRawJson.value[0].bodyData = transferRawJson.value[0].bodyData.map(
-    item => {
-      const scope = findScope(item.reference);
-      item.referenceStart = scope?.start || "";
-      item.referenceEnd = scope?.end || "";
-      item.date = dayjs(item.date).unix();
-      return item;
-    }
-  );
-  transferRawJson.value[0].date = dayjs(Date.now()).unix();
-  if (!transferRawJson.value[0]?.surveyData) {
-    transferRawJson.value[0].surveyData = [];
-  }
-  await request.post(
-    `/idcService/mechanism/medicalData/update/transferResult`,
-    {
-      sn: route.query.sn,
-      data: transferRawJson.value
-    }
-  );
-  ElMessage.success("保存成功");
-  editMonitoring.value = false;
-  getDetail && getDetail();
-};
-</script>
-
-<style lang="scss" scoped></style>

+ 0 - 195
src/views/dataCenter/components/MonitoringDataUpload.vue

@@ -1,195 +0,0 @@
-<template>
-  <div>
-    <div class="rounded border border-solid border-gray-100 p-4 mb-4">
-      <div
-        class="flex items-center pb-4 mb-2 space-x-2 border-0 border-b border-solid border-gray-100"
-      >
-        <div>
-          <span>关联的档案号(必填):</span>
-          <SearchArchivesSelect
-            v-model="archivesId"
-            :disabled="!!defaultArchivesId"
-          ></SearchArchivesSelect>
-        </div>
-        <div>
-          <span>检查数据:</span>
-          <el-select
-            v-model="curNode"
-            multiple
-            filterable
-            clearable
-            collapse-tags
-          >
-            <el-option
-              v-for="(item, index) in nodes"
-              :key="index"
-              :label="item.properties?.name"
-              :value="item.id"
-            ></el-option
-          ></el-select>
-        </div>
-        <el-button type="primary" :disabled="!curNode.length" @click="add"
-          >添加</el-button
-        >
-      </div>
-      <div>
-        <el-table :data="list">
-          <el-table-column label="项目名称" prop="name"></el-table-column>
-          <el-table-column label="检查结果(必填)">
-            <template #default="{ row }">
-              <el-input v-model="row.value" placeholder="请输入"></el-input>
-            </template>
-          </el-table-column>
-          <el-table-column label="参考范围(必填)">
-            <template #default="{ row }">
-              <el-input v-model="row.reference" placeholder="请输入"></el-input>
-            </template>
-          </el-table-column>
-          <el-table-column label="单位(必填)">
-            <template #default="{ row }">
-              <el-input v-model="row.unit" placeholder="请输入"></el-input>
-            </template>
-          </el-table-column>
-          <el-table-column label="检测时间(必填)" width="260">
-            <template #default="{ row }">
-              <el-date-picker
-                v-model="row.date"
-                type="datetime"
-                placeholder="请选择日期"
-                format="YYYY-MM-DD HH:mm:ss"
-                value-format="YYYY-MM-DD HH:mm:ss"
-                :disabled-date="disabledDate"
-              />
-            </template>
-          </el-table-column>
-          <el-table-column label="操作">
-            <template #default="{ row, $index }">
-              <el-button type="primary" link @click="addItem(row, $index)"
-                >继续添加该项目</el-button
-              >
-              <el-popconfirm
-                title="是否确定删除?"
-                @confirm="list.splice($index, 1)"
-              >
-                <template #reference>
-                  <el-button type="danger" link>删除</el-button>
-                </template>
-              </el-popconfirm>
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-    </div>
-    <div class="flex items-center"></div>
-    <div class="text-right">
-      <el-button type="primary" @click="confirm">保存并开始上传</el-button>
-    </div>
-  </div>
-</template>
-
-<script setup>
-import { ElMessage, ElLoading } from "element-plus";
-import { ref, shallowRef, inject, onMounted } from "vue";
-import { uploadToOSS, debounce, request, findScope, disabledDate } from "@/utils";
-import dayjs from "dayjs";
-import SearchArchivesSelect from "@/components/Archives/SearchArchivesSelect.vue";
-const getDataList = inject("getList");
-const closeUploadDialog = inject("closeUploadDialog");
-
-const defaultArchivesId = inject("defaultArchivesId") || "";
-const archivesId = ref(defaultArchivesId.value || "");
-const curNode = ref([]);
-const nodes = shallowRef([]);
-const list = ref([]);
-
-const searchNodes = async () => {
-  const { data } = await request.get(`/graphService/open/node/paginate`, {
-    params: {
-      page: 1,
-      pageSize: 9999,
-      tag: "日常监测指标"
-    }
-  });
-  nodes.value = data.list;
-};
-const searchRelateNodes = async (id, relationship) => {
-  if (!id) return;
-  const { data } = await request.get(`/graphService/open/node/related`, {
-    params: {
-      id,
-      relationship
-    }
-  });
-  return data;
-};
-const add = async () => {
-  const tmp = [];
-  for (const id of curNode.value) {
-    const raw = nodes.value.find(item => item.id == id);
-    const node = await searchRelateNodes(id, "可检测");
-    const relationship = await searchRelateNodes(id, "默认单位与范围");
-    console.log(raw, relationship);
-    tmp.push({
-      value: "",
-      unit: relationship[0]?.properties?.name,
-      reference: relationship[0]?.rProperties?.["参考范围"],
-      referenceStart: "",
-      referenceEnd: "",
-      abnormalId: [],
-      abnormalDatas: [],
-      name: raw.properties?.name,
-      id,
-      date: "",
-      itemId: node[0]?.id || ""
-    });
-  }
-  list.value.push(...tmp);
-};
-const addItem = (row, index) => {
-  const tmp = {
-    ...row
-  };
-  tmp.value = "";
-  list.value.splice(index + 1, 0, tmp);
-};
-const confirm = async () => {
-  if (!archivesId.value) {
-    return ElMessage.error("请选择关联档案");
-  }
-  for (const item of list.value) {
-    if ((!item.value && item.value !== 0) || !item.date) {
-      return ElMessage.error("请填写必填项");
-    }
-  }
-  const req = [
-    {
-      bodyData: list.value.map(item => {
-        const scope = findScope(item.reference);
-        console.log(scope);
-        item.referenceStart = scope?.start || "";
-        item.referenceEnd = scope?.end || "";
-        item.date = dayjs(item.date).unix();
-        return item;
-      }),
-      surveyData: [],
-      abnormalData: [],
-      date: dayjs(Date.now()).unix()
-    }
-  ];
-  console.log(req);
-  await request.post(`/medicalData/create`, {
-    type: 2,
-    archivesId: archivesId.value,
-    date: dayjs(Date.now()).format("YYYY-MM-DD HH:mm:ss"),
-    transferRawJson: JSON.stringify(req)
-  });
-  ElMessage.success("创建完成");
-  getDataList && getDataList();
-  closeUploadDialog && closeUploadDialog();
-};
-onMounted(() => {
-  searchNodes();
-});
-</script>
-
-<style lang="scss" scoped></style>

+ 0 - 218
src/views/dataCenter/components/NeedsUpload.vue

@@ -1,218 +0,0 @@
-<template>
-  <div>
-    <div
-      v-for="(item, index) in list"
-      :key="index"
-      class="rounded border border-solid border-gray-100 p-4 mb-4"
-    >
-      <div
-        class="flex justify-between items-center pb-4 mb-2 border-0 border-b border-solid border-gray-100"
-      >
-        <div>
-          <span>关联的档案号(选填):</span>
-          <SearchArchivesSelect
-            v-model="item.archivesId"
-            :disabled="!!defaultArchivesId"
-          ></SearchArchivesSelect>
-        </div>
-        <el-upload
-          :ref="r => appendUploadRefs.push(r)"
-          action="#"
-          multiple
-          :auto-upload="false"
-          :show-file-list="false"
-          :on-change="
-            (file, files) => appendFileChange(file, files, item, index)
-          "
-        >
-          <template #trigger>
-            <el-button type="primary">上传文件</el-button>
-          </template>
-        </el-upload>
-        <el-popconfirm title="是否确定删除?" @confirm="list.splice(index, 1)">
-          <template #reference>
-            <el-button type="danger" link>删除该批次</el-button>
-          </template>
-        </el-popconfirm>
-      </div>
-      <div>
-        <el-table :data="item.files">
-          <el-table-column label="文件名" prop="fileName"></el-table-column>
-          <el-table-column label="数据发生日期(必填)">
-            <template #default="{ row }">
-              <el-date-picker
-                v-model="row.date"
-                type="date"
-                placeholder="请选择日期"
-                format="YYYY-MM-DD"
-                value-format="YYYY-MM-DD"
-                :disabled-date="disabledDate"
-              />
-            </template>
-          </el-table-column>
-          <el-table-column label="操作">
-            <template #default="{ row, $index }">
-              <el-popconfirm
-                title="是否确定删除?"
-                @confirm="item.files.splice($index, 1)"
-              >
-                <template #reference>
-                  <el-button type="danger" link>删除</el-button>
-                </template>
-              </el-popconfirm>
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-    </div>
-    <div class="flex items-center">
-      <el-select v-model.number="uploadType">
-        <el-option label="新增单人数据" :value="0"></el-option>
-        <el-option label="新增多人数据" :value="1"></el-option>
-      </el-select>
-      <el-upload
-        ref="uploadRef"
-        v-model:file-list="uploadFiles"
-        action="#"
-        multiple
-        :auto-upload="false"
-        :show-file-list="false"
-        :on-change="uploadChange"
-      >
-        <template #trigger>
-          <el-button type="primary" class="ml-4">新增</el-button>
-        </template>
-      </el-upload>
-    </div>
-    <div>
-      <div class="my-2 text-red-500 text-xs">
-        新增单人数据时,如果上传了多份文件,那么这些文件都会放入同一个数据批次中
-      </div>
-      <div class="my-2 text-red-500 text-xs">
-        新增多人数据时,如果上传了多份文件,那么每一份文件都会创建一个独立的数据批次,您可以在每一个独立数据批次里面去追加单人的补充文件数据
-      </div>
-    </div>
-    <div class="text-right">
-      <el-button type="primary" :disabled="uploadLock" @click="createUploadTask"
-        >保存并开始上传</el-button
-      >
-    </div>
-  </div>
-</template>
-
-<script setup>
-import { ElMessage, ElLoading } from "element-plus";
-import { ref, inject } from "vue";
-import { uploadToOSS, debounce, request, disabledDate } from "@/utils";
-
-import SearchArchivesSelect from "@/components/Archives/SearchArchivesSelect.vue";
-const getDataList = inject("getList");
-const closeUploadDialog = inject("closeUploadDialog");
-
-const defaultArchivesId = inject("defaultArchivesId") || "";
-const list = ref([]);
-// uploadToOSS()
-const uploadType = ref(0);
-const uploadRef = ref();
-const uploadFiles = ref([]);
-const uploadChange = debounce((file, files) => {
-  console.log(uploadFiles.value, file, files);
-  if (uploadType.value) {
-    files.forEach(f => {
-      list.value.push({
-        type: uploadType.value,
-        archivesId: defaultArchivesId.value || "",
-        files: [
-          {
-            raw: f.raw,
-            fileName: f.name,
-            date: "",
-            fileUrl: "",
-            remark: ""
-          }
-        ]
-      });
-    });
-  } else {
-    list.value.push({
-      type: uploadType.value,
-      files: files.map(f => ({
-        raw: f.raw,
-        fileName: f.name,
-        date: "",
-        fileUrl: "",
-        remark: ""
-      })),
-      archivesId: defaultArchivesId.value || ""
-    });
-  }
-  uploadRef.value.clearFiles();
-}, 1e2);
-const appendUploadRefs = ref([]);
-const appendFileChange = debounce((file, files, item, index) => {
-  console.log(files, item);
-  console.log(appendUploadRefs.value[index]);
-  files.forEach(f => {
-    item.files.push({
-      raw: f.raw,
-      fileName: f.name,
-      date: "",
-      fileUrl: "",
-      remark: ""
-    });
-  });
-  appendUploadRefs.value.forEach(v => {
-    v.clearFiles && v.clearFiles();
-  });
-}, 1e2);
-
-const uploadLock = ref(false);
-const createUploadTask = async () => {
-  uploadLock.value = true;
-
-  const uploadFileTotal = list.value.reduce((a, b) => a + b.files.length, 0);
-  console.log(uploadFileTotal);
-  if (!uploadFileTotal) return ElMessage.error("请新增数据后保存");
-  if (
-    uploadFileTotal !=
-    list.value
-      .map(v => v.files.map(f => f.date))
-      .flat()
-      .filter(v => v).length
-  ) {
-    uploadLock.value = false;
-    return ElMessage.error("请填写所有文件的发生日期");
-  }
-  const loading = ElLoading.service({
-    lock: true,
-    text: "开始上传",
-    background: "rgba(255, 255, 255, 0.7)"
-  });
-  try {
-    let uploadCount = 0;
-    for (const item of list.value) {
-      for (const v of item.files) {
-        v.fileUrl = await uploadToOSS(v.raw, v.fileName);
-        uploadCount++;
-        loading.text = `正在上传文件${uploadCount}/${uploadFileTotal}`;
-      }
-    }
-
-    loading.text = `批次处理中`;
-    await Promise.all(
-      list.value.map(item => {
-        return request.post(`/medicalData/create`, { ...item, type: 7 });
-      })
-    );
-    ElMessage.success("创建完成");
-    getDataList();
-    closeUploadDialog();
-  } catch (e) {
-    console.log(e);
-  }
-  uploadLock.value = false;
-  loading.close();
-};
-</script>
-
-<style lang="scss" scoped></style>

+ 0 - 965
src/views/dataCenter/components/ProofTable.vue

@@ -1,965 +0,0 @@
-<template>
-  <div>
-    <el-table :data="item.rows" :resizable="false">
-      <el-table-column
-        v-for="(rowItem, rowItemIdx) in item.rows[0]"
-        :key="rowItemIdx"
-      >
-        <template #header>
-          <div v-if="item.label != 'text'">
-            <el-dropdown
-              :disabled="item.isPreviewModel"
-              trigger="click"
-              :show-timeout="0"
-              @command="projectCommand"
-            >
-              <el-button text :type="item.isPreviewModel ? '' : 'primary'">
-                <span>{{
-                  item.header[rowItemIdx]
-                    ? item.headerName
-                      ? item.headerName[rowItemIdx]
-                      : tableHeaderLabel[item.header[rowItemIdx]]
-                    : "多余列"
-                }}</span>
-                <operation class="m-l-2 w-4 h-4 inline-block" />
-              </el-button>
-              <template #dropdown>
-                <el-dropdown-menu>
-                  <el-dropdown-item
-                    :disabled="!rowItemIdx"
-                    :command="{
-                      method: projectExchangeLeft,
-                      params: [item, rowItemIdx]
-                    }"
-                    ><d-arrow-left
-                      class="w-4 h-4 inline-block"
-                    />交换左列</el-dropdown-item
-                  >
-                  <el-dropdown-item
-                    :disabled="rowItemIdx >= item.rows[0].length - 1"
-                    :command="{
-                      method: projectExchangeRight,
-                      params: [item, rowItemIdx]
-                    }"
-                    ><d-arrow-right
-                      class="w-4 h-4 inline-block"
-                    />交换右列</el-dropdown-item
-                  >
-                  <el-dropdown-item
-                    :command="{
-                      method: splitColumn,
-                      params: [item, rowItemIdx, -1]
-                    }"
-                    ><Fold class="w-4 h-4 inline-block" />
-                    拆分列,数字在前</el-dropdown-item
-                  >
-                  <el-dropdown-item
-                    :command="{
-                      method: splitColumn,
-                      params: [item, rowItemIdx, 1]
-                    }"
-                    ><Expand class="w-4 h-4 inline-block" />
-                    拆分列,数字在后</el-dropdown-item
-                  >
-                  <el-dropdown-item
-                    :command="{
-                      method: splitNumberColumn,
-                      params: [item, rowItemIdx]
-                    }"
-                    ><Scissor
-                      class="w-4 h-4 inline-block"
-                    />抽取数字列</el-dropdown-item
-                  >
-                  <el-dropdown-item
-                    :command="{
-                      method: deleteProjectColumn,
-                      params: [item, rowItemIdx]
-                    }"
-                    ><Delete
-                      class="w-4 h-4 inline-block"
-                    />删除列</el-dropdown-item
-                  >
-                </el-dropdown-menu>
-              </template>
-            </el-dropdown>
-            <!-- <span v-else>{{ item.header[rowItemIdx] ? (item.headerName ? item.headerName[rowItemIdx] : tableHeaderLabel[item.header[rowItemIdx]]) : '多余列' }}</span> -->
-          </div>
-          <span v-else>结果</span>
-        </template>
-        <template #default="{ row, $index }">
-          <template v-if="row[rowItemIdx]">
-            <template v-if="!item.isPreviewModel">
-              <template
-                v-if="
-                  item.header[rowItemIdx] == 'value' &&
-                  row[0].extra?.valueRegexType == 3
-                "
-              >
-                <el-select
-                  v-model="row[rowItemIdx].infer"
-                  :disabled="item.isPreviewModel"
-                  :class="{
-                    'no-match':
-                      item.header[rowItemIdx] == 'value'
-                        ? !verificationProjectRowVal(
-                            row[rowItemIdx].infer,
-                            row[0]
-                          )
-                        : rowItemIdx && !row[rowItemIdx].extra,
-                    'form-disabled': item.isPreviewModel
-                  }"
-                >
-                  <el-option
-                    v-for="(value, valueIndex) in row[0].extra?.valueRegexRule
-                      .data.valueList"
-                    :key="valueIndex"
-                    :label="value"
-                    :value="value"
-                  ></el-option>
-                </el-select>
-              </template>
-              <template
-                v-else-if="
-                  item.header[rowItemIdx] == 'value' &&
-                  row[0].extra?.valueLimit &&
-                  row[0].extra?.valueLimit.type == 3
-                "
-              >
-                <el-select
-                  v-model="row[rowItemIdx].infer"
-                  :disabled="item.isPreviewModel"
-                  filterable
-                  :class="{
-                    'no-match':
-                      item.header[rowItemIdx] == 'value'
-                        ? !verificationProjectRowVal(
-                            row[rowItemIdx].infer,
-                            row[0]
-                          )
-                        : rowItemIdx && !row[rowItemIdx].extra,
-                    'form-disabled': item.isPreviewModel
-                  }"
-                >
-                  <el-option
-                    v-for="(value, valueIndex) in row[0].extra?.valueLimit
-                      .value"
-                    :key="valueIndex"
-                    :label="value"
-                    :value="value"
-                  ></el-option>
-                </el-select>
-              </template>
-              <el-input
-                v-else
-                v-model.trim="row[rowItemIdx].infer"
-                :key="`${$index}-${rowItemIdx}`"
-                type="textarea"
-                :disabled="item.isPreviewModel"
-                :class="{
-                  'proof-input': true,
-                  'form-disabled': item.isPreviewModel,
-                  'no-match':
-                    item.header[rowItemIdx] == 'value'
-                      ? !verificationProjectRowVal(
-                          row[rowItemIdx].infer,
-                          row[0]
-                        )
-                      : rowItemIdx && !row[rowItemIdx].extra
-                }"
-                :resize="item.isPreviewModel ? 'none' : undefined"
-                :autosize="item.isPreviewModel ? false : { minRows: 1 }"
-              ></el-input>
-            </template>
-            <span
-              v-else
-              :class="{
-                'no-match':
-                  item.header[rowItemIdx] == 'value'
-                    ? !verificationProjectRowVal(row[rowItemIdx].infer, row[0])
-                    : rowItemIdx && !row[rowItemIdx].extra
-              }"
-              >{{ row[rowItemIdx].infer }}</span
-            >
-          </template>
-        </template>
-      </el-table-column>
-      <el-table-column v-if="isEditView" label="操作" width="80">
-        <template #default="{ row, $index }">
-          <el-dropdown
-            :disabled="item.isPreviewModel"
-            trigger="click"
-            :show-timeout="0"
-            @command="projectCommand"
-          >
-            <el-button
-              text
-              :type="item.isPreviewModel ? '' : 'primary'"
-              class="f-s-16"
-              ><operation class="m-r-2 w-4 h-4 inline-block"
-            /></el-button>
-            <template #dropdown>
-              <el-dropdown-menu>
-                <el-dropdown-item
-                  :command="{
-                    method: mergeProjectRow,
-                    params: [item, $index, 1]
-                  }"
-                  ><bottom
-                    class="w-4 h-4 inline-block"
-                  />向下合并</el-dropdown-item
-                >
-                <el-dropdown-item
-                  :command="{
-                    method: mergeProjectRow,
-                    params: [item, $index, -1]
-                  }"
-                  ><top
-                    class="w-4 h-4 inline-block"
-                  />向上合并</el-dropdown-item
-                >
-                <el-dropdown-item
-                  :command="{
-                    method: deleteProjectRow,
-                    params: [item, $index]
-                  }"
-                  ><delete
-                    class="w-4 h-4 inline-block"
-                  />删除行</el-dropdown-item
-                >
-                <el-dropdown-item
-                  :command="{
-                    method: addProjectRow,
-                    params: [item, $index]
-                  }"
-                  ><Plus class="w-4 h-4 inline-block" />添加行</el-dropdown-item
-                >
-              </el-dropdown-menu>
-            </template>
-          </el-dropdown>
-        </template>
-      </el-table-column>
-      <el-table-column
-        v-for="(col, colIdx) in item.label == 'indicator'
-          ? ['身体物质/部位', '检查项目']
-          : ['检查项目', '身体物质/部位']"
-        :label="col"
-      >
-        <template #default="{ row, $index }">
-          <template v-if="col == '身体物质/部位'">
-            <template v-if="!item.isPreviewModel">
-              <el-select
-                v-model="item.node[$index]"
-                :disabled="
-                  item.isPreviewModel ||
-                  (item.label == 'text' && !item.matchProject[$index])
-                "
-                :placeholder="
-                  item.isPreviewModel && !item.node[$index]
-                    ? ''
-                    : '请输入搜索后选择'
-                "
-                filterable
-                clearable
-                collapse-tags
-                remote
-                :class="{
-                  'no-match': !item.node[$index],
-                  'form-disabled': item.isPreviewModel
-                }"
-                :multiple="item.label == 'text'"
-                :remote-method="
-                  query =>
-                    item.label != 'text' && searchBodyNodes(query, idx, $index)
-                "
-                @change="matchNodeChange(item, idx, $index, row)"
-                @clear="matchNodeClear(item, $index)"
-              >
-                <!-- 'repeat-match':
-                            row[0].repeat && row[0].repeat.length, -->
-                <el-option
-                  v-for="(project, projectIdx) in item.nodes[$index]"
-                  :key="project.id"
-                  :label="project.properties?.name"
-                  :value="project.id"
-                  class="h-auto"
-                >
-                  <div class="">
-                    <div>{{ project.properties?.name }}</div>
-                    <div v-if="project.matched" class="text-gray-500 text-xs">
-                      匹配名称:{{ project.matched }}
-                    </div>
-                  </div>
-                </el-option>
-              </el-select>
-            </template>
-            <template v-else>
-              <span
-                v-if="
-                  Array.isArray(item.node[$index])
-                    ? item.node[$index].length
-                    : item.node[$index]
-                "
-              >
-                {{
-                  Array.isArray(item.node[$index])
-                    ? item.node[$index]
-                        .map(
-                          nodeId =>
-                            item.nodes[$index].find(v => v.id == nodeId)
-                              ?.properties?.name
-                        )
-                        .join()
-                    : item.nodes[$index].find(v => v.id == item.node[$index])
-                        ?.properties?.name
-                }}
-              </span>
-              <span v-else class="text-red-500">未匹配</span>
-            </template>
-          </template>
-          <template v-else>
-            <template v-if="!item.isPreviewModel">
-              <el-select
-                v-model="item.matchProject[$index]"
-                :disabled="
-                  item.isPreviewModel ||
-                  (item.label == 'indicator' && !item.node[$index])
-                "
-                :placeholder="
-                  item.isPreviewModel && !item.matchProject[$index]
-                    ? ''
-                    : '请输入搜索后选择'
-                "
-                filterable
-                clearable
-                remote
-                :class="{
-                  'no-match': !item.matchProject[$index],
-                  'form-disabled': item.isPreviewModel
-                }"
-                :remote-method="query => searchOcrIndicator(query, idx, $index)"
-                @change="matchProjectChange(item, idx, $index, $event)"
-                @clear="matchProjectClear(item, $index)"
-              >
-                <!-- 'repeat-match':
-                              row[0].repeat && row[0].repeat.length, -->
-                <el-option
-                  v-for="(project, projectIdx) in item.indicators[$index]"
-                  :key="project.id"
-                  :label="project.properties?.name"
-                  :value="project.id"
-                  class="h-auto"
-                >
-                  <div class="">
-                    <div>{{ project.properties?.name }}</div>
-                    <div v-if="project.matched" class="text-gray-500 text-xs">
-                      匹配名称:{{ project.matched }}
-                    </div>
-                  </div>
-                </el-option>
-              </el-select>
-            </template>
-            <template v-else>
-              <span v-if="item.matchProject[$index]">
-                {{
-                  item.indicators[$index].find(
-                    v => v.id == item.matchProject[$index]
-                  ).properties?.name
-                }}
-              </span>
-              <span v-else class="text-red-500">未匹配</span>
-            </template>
-          </template>
-        </template>
-      </el-table-column>
-    </el-table>
-    <div
-      v-if="item.children && item.children.length"
-      class="mt-2 bg-gray-50 p-4"
-    >
-      <div class="font-bold pb-2 border-b border-solid border-white">
-        <span class="text-gray-700">异常内容</span>
-      </div>
-      <div v-for="(child, childIdx) in item.children" :key="childIdx">
-        <div class="text-sm text-gray-600">
-          {{
-            item.rows[child.rowIdx] &&
-            item.rows[child.rowIdx][0] &&
-            item.rows[child.rowIdx][0]?.extra?.node?.properties?.name
-          }}
-        </div>
-        <template v-if="!item.isPreviewModel">
-          <div class="mb-2">
-            <el-select
-              v-model="child.curChildIndex"
-              multiple
-              filterable
-              collapse-tags
-              collapse-tags-tooltip
-              class="w-80"
-            >
-              <el-option
-                v-for="(childAlias, childAliasIdx) in child.abnormal"
-                :key="childAliasIdx"
-                :label="childAlias?.properties?.name"
-                :value="childAliasIdx"
-              ></el-option>
-            </el-select>
-          </div>
-        </template>
-        <div class="flex flex-wrap items-center">
-          <div
-            v-for="(childProject, childProjectIdx) in child.curChildIndex.map(
-              k => child.abnormal[k]
-            )"
-            class="mr-2 mb-2 bg-blue-50 text-blue-600 py-2 px-4 rounded text-sm w-fit"
-            :key="childProjectIdx"
-          >
-            <div class="flex items-center justify-between">
-              <span class="text-base">{{
-                childProject?.properties?.name
-              }}</span>
-              <Close
-                v-if="!item.isPreviewModel"
-                class="w-4 h-4 block cursor-pointer ml-2"
-                @click="child.curChildIndex.splice(childProjectIdx, 1)"
-              />
-            </div>
-            <template v-if="!item.isPreviewModel">
-              <div
-                v-if="childProject.properties?.props?.length"
-                class="space-y-2 mt-2"
-              >
-                <div
-                  v-for="(attr, attrIdx) in childProject.properties?.props"
-                  :key="attrIdx"
-                >
-                  <span class="mr-2">{{ attr.name }}</span>
-
-                  <template v-if="attr.type == 1">
-                    <el-input
-                      v-model.number="attr.val"
-                      class="w-52 margin-left-10"
-                      :placeholder="attr.placeholder || '请输入'"
-                    ></el-input>
-                  </template>
-                  <template v-if="attr.type == 2">
-                    <el-input
-                      v-model.number="attr.val"
-                      type="number"
-                      :min="Number(attr.min)"
-                      :max="Number(attr.max)"
-                      class="w-52 margin-left-10"
-                      :placeholder="attr.placeholder || '请输入'"
-                    ></el-input>
-                  </template>
-                  <template v-if="attr.type == 3">
-                    <el-select v-model="attr.val">
-                      <el-option
-                        v-for="(value, valueIndex) in attr.value"
-                        :key="valueIndex"
-                        :label="value"
-                        :value="value"
-                      ></el-option>
-                    </el-select>
-                  </template>
-                </div>
-                <template v-if="childProject.type == 1">
-                  <el-input
-                    v-model="childProject.val"
-                    type="number"
-                    size="small"
-                    :max="
-                      (childProject.valueRegexRule &&
-                        childProject.valueRegexRule.data &&
-                        childProject.valueRegexRule.data.total.max) ||
-                      undefined
-                    "
-                    class="w-32 margin-left-10"
-                    placeholder="请输入"
-                  ></el-input>
-                  <el-select
-                    v-if="childProject.units.length"
-                    v-model="childProject.unit"
-                    size="small"
-                  >
-                    <el-option
-                      v-for="(unit, unitIdx) in childProject.units"
-                      :key="unitIdx"
-                      :label="unit.name"
-                      :value="unit.name"
-                    ></el-option>
-                  </el-select>
-                </template>
-                <template v-if="childProject.type == 2">
-                  <el-input
-                    v-model="childProject.val"
-                    size="small"
-                    :maxlength="
-                      (childProject.valueRegexRule &&
-                        childProject.valueRegexRule.data &&
-                        childProject.valueRegexRule.data.total.max) ||
-                      undefined
-                    "
-                    class="w-32 margin-left-10"
-                    placeholder="请输入"
-                  ></el-input>
-                  <el-select
-                    v-if="childProject.units.length"
-                    v-model="childProject.unit"
-                    size="small"
-                  >
-                    <el-option
-                      v-for="(unit, unitIdx) in childProject.units"
-                      :key="unitIdx"
-                      :label="unit"
-                      :value="unit"
-                    ></el-option>
-                  </el-select>
-                </template>
-                <el-select
-                  v-if="childProject.type == 3"
-                  v-model="childProject.val"
-                  size="small"
-                >
-                  <el-option
-                    v-for="(value, valueIndex) in childProject.valueRegexRule
-                      .data.valueList"
-                    :key="valueIndex"
-                    :label="value"
-                    :value="value"
-                  ></el-option>
-                </el-select>
-              </div>
-            </template>
-            <template v-else>
-              <template v-if="childProject.valueRegexType > 0">
-                :{{ childProject.val }}
-                {{ childProject.unit || "" }}
-              </template>
-              <tr
-                v-for="(attr, attrIdx) in childProject.properties?.props"
-                :key="attrIdx"
-              >
-                <td>
-                  <span class="mr-2">{{ attr.name }}</span>
-                </td>
-                <td>
-                  <span class="text-gray-600">{{ attr.val }}</span>
-                </td>
-              </tr>
-            </template>
-          </div>
-        </div>
-      </div>
-    </div>
-  </div>
-</template>
-
-<script setup>
-import { ref, computed, inject } from "vue";
-import {
-  CopyDocument,
-  Close,
-  Delete,
-  Scissor,
-  Expand,
-  Fold,
-  DArrowLeft,
-  DArrowRight,
-  Operation,
-  Top,
-  Plus,
-  Bottom
-} from "@element-plus/icons-vue";
-
-import { ElMessage, ElLoading, ElMessageBox } from "element-plus";
-const props = defineProps({
-  info: {
-    type: Object,
-    default: undefined
-  },
-  edit: {
-    type: Boolean,
-    default: false
-  },
-  list: {
-    type: Array,
-    default: []
-  },
-  idx: {
-    type: Number,
-    default: undefined
-  }
-});
-const emit = defineEmits(["update:info", "update:edit"]);
-const item = computed({
-  get() {
-    return props.info;
-  },
-  set(v) {
-    emit("update:info");
-  }
-});
-const isEditView = computed({
-  get() {
-    return props.info;
-  },
-  set(v) {
-    emit("update:edit");
-  }
-});
-const list = computed(() => props.list);
-const idx = computed(() => props.idx);
-const searchAddNodes = inject("searchAddNodes");
-const searchRelateNodes = inject("searchRelateNodes");
-
-const formatChildProjectChildren = inject("formatChildProjectChildren");
-
-const tableHeaderLabel = {
-  key: "项目名称",
-  value: "检验结果",
-  unit: "单位",
-  scope: "参考范围"
-};
-
-const recognitionType = ["身体物质/部位", "医学检查项目"];
-const relatedRelationship = ["异常属于", "可检测"];
-
-const swapProjectExchange = (item, idx, direction = 1) => {
-  const afterIdx = idx + direction;
-  item.rows.forEach(row => {
-    swap(row, idx, afterIdx);
-  });
-};
-// 拆分列
-const splitColumn = (item, rowIdx, direction) => {
-  console.log(
-    "splitColumn",
-    item,
-    rowIdx,
-    item.rows,
-    item.rows.map(v => v[rowIdx])
-  );
-  // direction > 0 ?
-  let addFlag = false;
-  let tRows = item.rows.map(v => {
-    let tVal =
-      direction > 0
-        ? formatProjectLastColumnVal(v[rowIdx].infer)
-        : formatProjectFirstColumnVal(v[rowIdx].infer);
-    console.log(tVal);
-    if (Array.isArray(tVal) && tVal.length > 1) {
-      addFlag = true;
-    }
-    return tVal;
-  });
-  if (!addFlag) {
-    return ElMessage.error("未找到数字");
-  }
-  tRows.forEach((val, idx) => {
-    if (addFlag) {
-      console.log(val);
-      if (Array.isArray(val) && val.length > 1) {
-        item.rows[idx][rowIdx].infer = val[1];
-        item.rows[idx].splice(rowIdx, 0, {
-          ...item.rows[idx][rowIdx],
-          infer: val[0]
-        });
-      } else {
-        item.rows[idx].splice(direction > 0 ? rowIdx + 1 : rowIdx, 0, {
-          ...item.rows[idx][rowIdx],
-          infer: ""
-        });
-      }
-    }
-  });
-};
-const formatProjectFirstColumnVal = v => {
-  if (!v && v !== 0) return v;
-  console.log(v);
-  let firstIdx = v.split("").findIndex(v => v !== "." && isNaN(Number(v)));
-  return [v.slice(0, firstIdx), v.slice(firstIdx)].filter(v => v || v === 0);
-};
-const formatProjectLastColumnVal = v => {
-  if (!v && v !== 0) return v;
-  let lastIdx =
-    v.split("").findLastIndex(v => v !== "." && isNaN(Number(v))) + 1;
-  if (lastIdx == v.length) return v;
-  let result = [v.slice(0, lastIdx), v.slice(lastIdx)].filter(
-    v => v || v === 0
-  );
-  return result;
-};
-const splitNumberColumn = (item, colIdx) => {
-  item.rows.forEach((row, idx) => {
-    let tempNumCol = row[colIdx].infer.replace(/\D/g, "");
-    row[colIdx].infer = row[colIdx].infer.replace(/\d/g, "");
-    row.splice(colIdx, 0, {
-      ...row,
-      infer: tempNumCol
-    });
-  });
-};
-
-const deleteProjectColumn = (item, rowIdx) => {
-  console.log("deleteProjectColumn", item, rowIdx);
-  const checkLen = item.header.filter(v => v).length;
-  if (item.rows[0].length <= checkLen) {
-    return ElMessage.error("必须保留", item.headerName);
-  }
-  item.rows.forEach(row => {
-    row.splice(rowIdx, 1);
-  });
-};
-
-const deleteProjectRow = (item, $index) => {
-  item.rows.splice($index, 1);
-  item.indicators.splice($index, 1);
-  item.matchProject.splice($index, 1);
-  item.node.splice($index, 1);
-  item.nodes.splice($index, 1);
-  const childIdx = item.children.findIndex(v => v.rowIdx == $index);
-  console.log(childIdx)
-  if (childIdx > -1) {
-    item.children.splice(childIdx, 1)
-    item.children.forEach(v => {
-      if (v.rowIdx > childIdx) {
-        v.rowIdx--;
-      }
-    })
-  }
-  console.log(item)
-};
-const addProjectRow = (item, $index) => {
-  if (item.label == "text") {
-    item.rows.splice($index + 1, 0, [
-      {
-        extra: null,
-        infer: ""
-      }
-    ]);
-    item.node.splice($index + 1, 0, []);
-  } else {
-    item.rows.splice(
-      $index + 1,
-      0,
-      Array(4)
-        .fill(0)
-        .map(() => ({
-          extra: null,
-          infer: ""
-        }))
-    );
-
-    item.node.splice($index + 1, 0, "");
-  }
-  item.matchProject.splice($index + 1, 0, "");
-  item.indicators.splice($index + 1, 0, []);
-  item.nodes.splice($index + 1, 0, []);
-};
-
-const mergeProjectRow = (item, index, direction) => {
-  item.rows[0].forEach((_, key) => {
-    if (direction < 0) {
-      item.rows[index + direction][key].infer += item.rows[index][key].infer;
-    } else {
-      item.rows[index + direction][key].infer =
-        item.rows[index][key].infer + item.rows[index + direction][key].infer;
-    }
-    const filter = {};
-    const nodeFilter = {};
-    item.nodes[index + direction] = [
-      ...item.nodes[index],
-      ...item.nodes[index + direction]
-    ].filter(v => {
-      if (!nodeFilter[v.id]) {
-        nodeFilter[v.id] = 1;
-        return true;
-      }
-      return false;
-    });
-    item.node[index + direction] = item.node[index + direction]
-      ? item.node[index + direction]
-      : item.node[index];
-    item.indicators[index + direction] = [
-      ...item.indicators[index],
-      ...item.indicators[index + direction]
-    ].filter(v => {
-      if (!filter[v.id]) {
-        filter[v.id] = 1;
-        return true;
-      }
-      return false;
-    });
-    item.matchProject[index + direction] = item.matchProject[index + direction]
-      ? item.matchProject[index + direction]
-      : item.matchProject[index];
-  });
-  deleteProjectRow(item, index);
-};
-
-const searchBodyNodes = async (key, index, rowIdx) => {
-  if (!key) return;
-  const nodes =
-    (await searchAddNodes(key, false, {
-      type: 0
-    })) || [];
-  const dataIds = nodes.map(v => v.id);
-  console.log(list.value);
-  let findItem = list.value[index].nodes[rowIdx].find(
-    v => v.id == list.value[index].node[rowIdx]
-  );
-  list.value[index].nodes[rowIdx] =
-    findItem && !dataIds.includes(findItem.id) ? [findItem, ...nodes] : nodes;
-};
-const matchNodeChange = async (item, index, rowIdx, row) => {
-  console.log(item, row, item.nodes[rowIdx]);
-  const appendChildren = [];
-  if (item.label == "indicator") {
-    const curNode = item.nodes[rowIdx].find(v => item.node[rowIdx] == v.id);
-    const projects = await searchRelateNodes(item.node[rowIdx], 1);
-    item.matchProject[rowIdx] = "";
-    item.indicators[rowIdx] = projects;
-    if (row[0].extra) {
-      row[0].extra.node = curNode;
-    }
-    if (
-      curNode &&
-      curNode.properties["类型编号"] &&
-      Number(curNode.properties["类型编号"][0]) == 0
-    ) {
-      const abnormal = await searchRelateNodes(item.node[rowIdx], 0);
-      abnormal.length &&
-        appendChildren.push({
-          id: item.node[rowIdx],
-          abnormal
-        });
-    }
-  }
-  console.log(item);
-  if (item.label == "text") {
-    const curNodes = item.node[rowIdx].filter(v => {
-      const curNode = item.nodes[rowIdx].find(v2 => v == v2.id);
-      return (
-        curNode.properties["类型编号"] &&
-        Number(curNode.properties["类型编号"][0]) == 0
-      );
-    });
-    if (curNodes?.length) {
-      const data = await searchRelateNodes(curNodes.join(","), 0);
-      data.length &&
-        appendChildren.push({
-          id: item.node[rowIdx],
-          abnormal: data
-        });
-    }
-  }
-  console.log(item.children);
-  const children = item.children.filter(v => v.rowIdx != rowIdx);
-  const temps = [];
-  appendChildren.forEach(child => {
-    const temp = formatChildProjectChildren(child, { rowIdx });
-    temps.push(temp);
-  });
-  item.children = children.concat(temps);
-};
-const matchNodeClear = (item, rowIdx) => {
-  if (item.label == "indicator") {
-    item.nodes[rowIdx] = [];
-    item.matchProject[rowIdx] = "";
-    item.indicators[rowIdx] = [];
-  }
-};
-const searchOcrIndicator = async (key, index, rowIdx) => {
-  if (!key) return;
-  const nodes =
-    (await searchAddNodes(key, false, {
-      type: 1
-    })) || [];
-  const dataIds = nodes.map(v => v.id);
-  let findItem = list.value[index].indicators[rowIdx].find(
-    v => v.id == list.value[index].matchProject[rowIdx]
-  );
-  list.value[index].indicators[rowIdx] =
-    findItem && !dataIds.includes(findItem.id) ? [findItem, ...nodes] : nodes;
-};
-const matchProjectChange = async (item, index, rowIdx, event) => {
-  if (item.label == "text") {
-    const nodes = await searchRelateNodes(item.matchProject[rowIdx], 1);
-    item.node[rowIdx] = [];
-    item.nodes[rowIdx] = nodes;
-  }
-};
-const matchProjectClear = (item, rowIdx) => {
-  if (item.label == "text") {
-    item.node[rowIdx] = [];
-    item.nodes[rowIdx] = [];
-    item.matchProject[rowIdx] = "";
-    item.indicators[rowIdx] = [];
-  }
-};
-const changeEditModule = (item, index) => {
-  list.value.forEach((v, k) => {
-    v.isPreviewModel = k == index ? !v.isPreviewModel : true;
-  });
-};
-
-const verificationProjectRowVal = (val, row) => {
-  // console.log(val, row);
-  if (!row.extra) return true;
-  const { valueRegexType, valueRegexRule } = row.extra;
-
-  if (valueRegexType < 0) {
-    return true;
-  }
-  if (!valueRegexRule) return true;
-
-  let rule;
-  if (typeof valueRegexRule != "object") {
-    try {
-      rule = JSON.parse(valueRegexRule);
-      row.extra.valueRegexRule = rule;
-    } catch (e) {
-      console.log(e);
-    }
-  } else {
-    rule = valueRegexRule;
-  }
-  // console.log(rule);
-
-  switch (valueRegexType) {
-    case 1:
-      if (isNaN(Number(val))) return false;
-      if (rule.data && rule.data.total && rule.data.total.max) {
-        return val >= rule.data.total.min && val <= rule.data.total.max;
-      }
-      return val >= rule.data.total.min;
-    case 2:
-      if (rule.data.total.max) {
-        return val.length <= rule.data.total.max;
-      }
-      return val.length >= rule.data.total.min || 0;
-    case 3:
-      return rule.data.valueList.includes(val);
-  }
-};
-
-const projectCommand = command => {
-  console.log({ ...command });
-
-  eval(command.method)(...command.params);
-};
-
-const projectExchangeLeft = (item, rowIdx) => {
-  swapProjectExchange(item, rowIdx, -1);
-};
-
-const projectExchangeRight = (item, rowIdx) => {
-  swapProjectExchange(item, rowIdx);
-};
-const swap = (arr, idx1, idx2) => {
-  [arr[idx1], arr[idx2]] = [arr[idx2], arr[idx1]];
-};
-</script>
-
-<style lang="scss" scoped></style>

+ 0 - 778
src/views/dataCenter/components/QuestionItem.vue

@@ -1,778 +0,0 @@
-<template>
-  <div class="py-4">
-    <!-- <p v-if="item.type !== QUESTION_TYPE_TEXT" class="survey-title">{{ item.number }} {{ item.config.desc }}</p>
-    <div v-else-if="item.isHtml" class="survey-title" v-html="item.config.desc"></div>
-    <p v-else class="survey-title">{{ item.config.desc }}</p> -->
-    <!-- 临时选项 -->
-    <!-- 常规显示 -->
-    <template v-if="item.type === QUESTION_TYPE_TEMP_CHECK">
-      <div class="text-left">
-        <p class="survey-desc">{{ item.remark }}</p>
-        <template v-if="props.child">
-          <transition name="slide">
-            <div class="text-right padding-top-10">
-              <el-button
-                color="#4B72F6"
-                class="i-h-34px confirm-input-btn"
-                @click="check(item, true)"
-                >是</el-button
-              >
-
-              <el-button
-                class="i-h-34px confirm-input-btn"
-                @click="check(item, false)"
-                >否</el-button
-              >
-            </div>
-          </transition>
-        </template>
-      </div>
-    </template>
-    <div class="pb-3" v-if="item.config?.desc || item?.title" :border="false">
-      <div class="text-gray-500 whitespace-pre-wrap">
-        {{ item.config?.desc || item?.title }}
-      </div>
-      <div v-if="item.remark" class="text-xs text-gray-500 whitespace-pre-wrap">
-        {{ item.remark }}
-      </div>
-    </div>
-    <template v-if="item.type === QUESTION_TYPE_INPUT">
-      <el-input
-        v-model="item.value"
-        :disabled="!!item.disabled"
-        placeholder="请输入"
-        :type="fieldTypeFormat(item.config?.rule)"
-        autocomplete="false"
-        border
-        @blur="reply(item)"
-      />
-    </template>
-    <template v-else-if="item.type === QUESTION_TYPE_DATE">
-      <!-- <EditDatetimeCell v-model:value="item.value" :type="item.config.type" :placeholder="item?.config?.desc" @confirm="reply(item)" /> -->
-      <el-date-picker
-        v-model="item.value"
-        :disabled="!!item.disabled"
-        :type="dateType(item.config.type || QUESTION_TYPE_DATE)"
-        :value-format="dateTypeFormat(item.config.type)"
-        :editable="false"
-        :placeholder="item?.config?.desc"
-        :validate-event="false"
-        :append-to-body="false"
-        @change="reply(item)"
-      />
-    </template>
-    <template v-else-if="item.type === QUESTION_TYPE_RADIO">
-      <div class="p-4">
-        <el-radio-group
-          v-model="item.value"
-          :disabled="!!item.disabled"
-          direction="horizontal"
-          @change="reply(item)"
-        >
-          <el-radio
-            v-for="(child, idx) in item.choices"
-            :key="idx"
-            :label="idx"
-            >{{ child.label }}</el-radio
-          >
-        </el-radio-group>
-      </div>
-      <template v-if="item.value || item.value === 0">
-        <el-input
-          v-for="(inputChild, inputIdx) in item.choices?.filter((v: any, k: number) => v.isInput && item.value === k)"
-          v-model="inputChild.extra"
-          :key="inputIdx"
-          :label="inputChild.label"
-          :placeholder="inputChild.inputPlaceholder || '请输入'"
-          class="mb-2"
-          :disabled="!!item.disabled"
-          @blur="reply(item)"
-        >
-          <template #prepend>{{ inputChild.label }}</template>
-        </el-input>
-      </template>
-    </template>
-    <template v-else-if="item.type === QUESTION_TYPE_CHECKBOX">
-      <div class="p-4" :border="false">
-        <div class="checkbox-list">
-          <el-button
-            v-for="(child, idx) in item.choices"
-            :key="idx"
-            round
-            class="checkbox-item mb-2"
-            :type="item?.value?.includes(idx) ? 'primary' : 'default'"
-            @click="changeCheckboxItem(item, idx)"
-            >{{ child.label }}</el-button
-          >
-        </div>
-      </div>
-      <template v-if="item.value && Array.isArray(item.value)">
-        <el-input
-          v-for="(inputChild, inputIdx) in item.choices?.filter((v: any, k: number) => v.isInput && item.value.includes(k))"
-          :key="inputIdx"
-          v-model="inputChild.extra"
-          :label="inputChild.label"
-          :placeholder="inputChild.inputPlaceholder || '请输入'"
-          class="mb-2"
-          :disabled="!!item.disabled"
-          @blur="reply(item)"
-        >
-          <template #prepend>{{ inputChild.label }}</template>
-        </el-input>
-      </template>
-    </template>
-    <template v-else-if="item.type === QUESTION_TYPE_MATRIX">
-      <div class="p-4" :border="false">
-        <div class="survey-matrix-container">
-          <table class="survey-matrix">
-            <tr>
-              <th />
-              <th v-for="(subTh, subThIdx) in item.columns" :key="subThIdx">
-                {{ subTh.label }}
-              </th>
-            </tr>
-            <tr v-for="(row, rowIdx) in item.rows" :key="rowIdx">
-              <td>{{ row.label }}</td>
-              <td
-                v-for="(col, colIdx) in item.columns"
-                :key="colIdx"
-                @click="checkMatrix(item, rowIdx, colIdx)"
-              >
-                <div
-                  v-if="item.matrix[rowIdx][colIdx]"
-                  class="flex items-center justify-center"
-                >
-                  <CircleCheckFilled class="text-lg text-blue-700" />
-                </div>
-                <div v-else class="h-4" />
-              </td>
-            </tr>
-          </table>
-        </div>
-      </div>
-    </template>
-    <!-- 组合题 -->
-    <template v-else-if="item.type === QUESTION_TYPE_GROUP">
-      <!-- 常规显示 -->
-      <div class="text-left">
-        <template v-if="props.child">
-          <transition name="slide">
-            <div>
-              <!-- <p class="survey-desc">{{ item.config.desc }}</p> -->
-              <div v-for="(sub, subIdx) in item.children" :key="subIdx">
-                <QuestionItem
-                  v-model:info="item.children[subIdx]"
-                  :child="true"
-                  class="w-100"
-                  @skip="skip"
-                  @back="back"
-                  @check-matrix="checkMatrix"
-                  @reply="reply"
-                />
-              </div>
-            </div>
-          </transition>
-        </template>
-      </div>
-    </template>
-    <template v-else-if="item.type === QUESTION_TYPE_MEDICINE">
-      <!-- 常规显示 -->
-      <div class="text-left">
-        <template v-if="props.child">
-          <transition name="slide">
-            <div ref="selectRef">
-              <el-select
-                v-if="!item.config.showInput"
-                v-model="item.value"
-                filterable
-                placeholder="请选择或输入搜索"
-                @hook:mounted="cancelReadOnly"
-                @visible-change="cancelReadOnly"
-              >
-                <el-option
-                  v-for="(searchItem, searchIdx) in item.searchList"
-                  :key="searchIdx"
-                  :label="searchItem.name"
-                  :value="searchItem.name"
-                />
-              </el-select>
-              <div v-if="item.config?.isInput">
-                <el-button
-                  v-if="!item.config.showInput"
-                  class="mt-4"
-                  type="primary"
-                  link
-                  @click="
-                    item.value = '';
-                    item.config.showInput = true;
-                  "
-                  >没有找到对应的药品?</el-button
-                >
-                <template v-else>
-                  <el-input
-                    v-model="item.value"
-                    class="mt-4"
-                    placeholder="请输入药品名称"
-                    clearable
-                  />
-                  <el-button
-                    class="mt-4"
-                    type="primary"
-                    link
-                    @click="
-                      item.value = '';
-                      item.config.showInput = false;
-                    "
-                    >重新选择</el-button
-                  >
-                </template>
-              </div>
-            </div>
-          </transition>
-        </template>
-      </div>
-    </template>
-    <template v-else-if="item.type === QUESTION_TYPE_DISEASE">
-      <!-- 常规显示 -->
-      <div class="text-left">
-        <template v-if="props.child">
-          <transition name="slide">
-            <div ref="selectRef">
-              <el-select
-                v-if="!item.config.showInput"
-                v-model="item.value"
-                placeholder="请选择或输入搜索"
-                filterable
-                @hook:mounted="cancelReadOnly"
-                @visible-change="cancelReadOnly"
-              >
-                <el-option
-                  v-for="(searchItem, searchIdx) in item.searchList"
-                  :key="searchIdx"
-                  :label="searchItem.name"
-                  :value="searchItem.name"
-                />
-              </el-select>
-              <div v-if="item.config?.isInput">
-                <el-button
-                  v-if="!item.config.showInput"
-                  class="mt-4"
-                  type="primary"
-                  link
-                  @click="
-                    item.value = '';
-                    item.config.showInput = true;
-                  "
-                  >没有找到对应的疾病?</el-button
-                >
-                <template v-else>
-                  <el-input
-                    v-model="item.value"
-                    class="mt-4"
-                    placeholder="请输入疾病名称"
-                    clearable
-                  />
-                  <el-button
-                    class="mt-4"
-                    type="primary"
-                    link
-                    @click="
-                      item.value = '';
-                      item.config.showInput = false;
-                    "
-                    >重新选择</el-button
-                  >
-                </template>
-              </div>
-            </div>
-          </transition>
-        </template>
-      </div>
-    </template>
-    <template v-else-if="item.type === QUESTION_TYPE_UPLOAD">
-      <UploadImage
-        v-model:url="item.value"
-        :type="item.config.fileType"
-        :size-limit="item.config.fileSizeLimit || 0"
-      />
-    </template>
-
-    <!-- 下拉题 -->
-    <template v-else-if="item.type === QUESTION_TYPE_SELECT">
-      <!-- 常规显示 -->
-      <div
-        class="flex text-left items-center hover:bg-gray-50 border-0 border-b border-gray-200 border-solid cursor-pointer"
-      >
-        <template v-if="props.child">
-          <div class="flex-1 p-4" @click="openSelect">
-            <div is-link>
-              <span class="text-gray-600">{{
-                item.value && item.value?.length
-                  ? item.value?.map(v => v.value).join()
-                  : "请选择"
-              }}</span>
-            </div>
-          </div>
-          <arrow-right class="h-4" />
-        </template>
-      </div>
-      <el-dialog v-model="selectVisible" :title="item.title">
-        <div v-if="selectChecked.length" class="p-4">
-          <p>已选择:</p>
-          <div
-            v-for="(checkItem, checkIdx) in selectChecked"
-            :key="checkIdx"
-            class="inline-flex items-center bg-gray-100 rounded-full text-gray-600 text-sm p-1 px-3 m-1"
-          >
-            <span>{{ checkItem.properties.name }}</span>
-
-            <close
-              class="ml-2 cursor-pointer w-4"
-              @click="selectChecked.splice(checkIdx, 1)"
-            />
-          </div>
-        </div>
-        <div class="flex p-4">
-          <el-input
-            type="primary"
-            link
-            v-model="selectKeyword"
-            class="mr-4"
-            clearable
-            placeholder="请输入后搜索"
-            @input="throttleSearch"
-            @keyup.enter="searchSelectOptions"
-          />
-          <el-button type="primary" @click="searchSelectOptions"
-            >搜索</el-button
-          >
-        </div>
-        <div v-if="item.config.isAppendNull" class="px-4 text-sm text-gray-500">
-          未搜索到?可填入后直接保存
-        </div>
-        <div class="max-h-[50vh] overflow-y-auto grid grid-cols-2">
-          <div
-            v-for="(selectItem, selectIndex) in selectOptions"
-            :key="selectIndex"
-            class="cursor-pointer border-b border-solid border-gray-100 py-2 px-4 flex"
-            :class="{
-              'font-bold text-blue-700 bg-blue-50 rounded': selectChecked.find(
-                v => v.id == selectItem.id
-              )
-            }"
-            @click="selectItemChange(selectItem)"
-          >
-            <span>{{ selectItem.properties?.name }}</span>
-            <Check
-              v-if="selectChecked.find(v => v.id == selectItem.id)"
-              class="w-4"
-            />
-          </div>
-          <el-empty v-if="!selectOptions.length" description="暂无数据" />
-        </div>
-        <template #footer>
-          <el-button class="flex-1" @click="selectVisible = false"
-            >取消</el-button
-          >
-          <el-button type="primary" class="flex-1" @click="saveSelect"
-            >保存</el-button
-          >
-        </template>
-      </el-dialog>
-    </template>
-    <slot />
-  </div>
-</template>
-
-<script setup lang="ts">
-import {
-  defineProps,
-  defineEmits,
-  PropType,
-  computed,
-  ref,
-  onMounted,
-  nextTick
-} from "vue";
-import { formatAge, request, throttle } from "@/utils";
-import QuestionItem from "./QuestionItem.vue";
-
-import {
-  CircleCheckFilled,
-  Check,
-  Close,
-  ArrowRight
-} from "@element-plus/icons-vue";
-import {
-  QUESTION_TYPE_TEMP_CHECK,
-  QUESTION_TYPE_ANSWER,
-  QUESTION_TYPE_INPUT,
-  QUESTION_TYPE_TEXT,
-  QUESTION_TYPE_CHECKBOX,
-  QUESTION_TYPE_RADIO,
-  QUESTION_TYPE_RATING_SCALE,
-  QUESTION_TYPE_RATING,
-  QUESTION_TYPE_DATE,
-  QUESTION_TYPE_MATRIX,
-  QUESTION_TYPE_COMBINATION,
-  QUESTION_TYPE_DISEASE,
-  QUESTION_TYPE_MEDICINE,
-  QUESTION_TYPE_GROUP,
-  QUESTION_TYPE_UPLOAD,
-  QUESTION_TYPE_SELECT
-} from "@/enums/question";
-import UploadImage from "@/components/UploadImage.vue";
-import { ElMessage, DatePickType } from "element-plus";
-
-const emits = defineEmits([
-  "update:info",
-  "skip",
-  "back",
-  "check",
-  "reply",
-  "repeat",
-  "checkMatrix"
-]);
-const props = defineProps({
-  info: {
-    type: Object,
-    default: () => {}
-  },
-  hideList: {
-    type: Array as PropType<Array<string>>,
-    default: () => []
-  },
-  repeatAnswer: {
-    type: Boolean,
-    default: false
-  },
-  child: {
-    type: Boolean,
-    default: false
-  }
-});
-// console.log(props.info);
-
-const item = computed({
-  get() {
-    return props.info;
-  },
-  set(value) {
-    emits("update:info", value);
-  }
-});
-
-const dateTypeFormat = (type: string) => {
-  switch (type) {
-    case "year":
-      return "YYYY";
-    case QUESTION_TYPE_DATE:
-      return "YYYY-MM-DD";
-    default:
-      return "YYYY-MM-DD HH:mm:ss";
-  }
-};
-const dateTypes = [
-  "year",
-  "month",
-  "date",
-  "dates",
-  "week",
-  "datetime",
-  "datetimerange",
-  "daterange",
-  "monthrange"
-];
-const dateType = (type: DatePickType): DatePickType => {
-  if (!dateTypes.includes(type)) {
-    return "date";
-  }
-  return type;
-};
-const fieldTypeFormat = (rule: string) => {
-  switch (rule) {
-    case "number":
-      return "number";
-    case "mobile":
-      return "tel";
-    default:
-      return "text";
-  }
-};
-
-const init = () => {
-  // console.log(props.info);
-  switch (item.value.type) {
-    case QUESTION_TYPE_INPUT:
-      if (item.value.selectValues?.length) {
-        item.value.value = item.value.selectValues[0].value;
-      }
-      break;
-    case QUESTION_TYPE_DISEASE:
-    case QUESTION_TYPE_MEDICINE:
-      fetchSearchList(item.value.type);
-      break;
-
-    case QUESTION_TYPE_SELECT:
-      if (item.value.value) {
-        selectChecked.value = item.value.value.map(v => {
-          return {
-            id: v.key,
-            properties: {
-              name: v.value
-            }
-          };
-        });
-      }
-      break;
-  }
-};
-
-const replyLock = ref(false);
-
-const inputType = (rule: string): string => {
-  switch (rule) {
-    case "number":
-      return rule;
-    case "phone":
-      return "tel";
-    default:
-      return "text";
-  }
-};
-
-const changeCheckboxItem = (item: any, idx: number, other?: boolean) => {
-  if (!Array.isArray(item.value)) {
-    item.value = [idx];
-    console.log(item.value);
-  } else {
-    if (item.choices![idx].mutuallyExclusive) {
-      if (!item.value.includes(idx)) {
-        item.value = [idx];
-      } else {
-        item.value = [];
-      }
-    } else {
-      item.value = item.value?.filter(
-        (v: number) => !item.choices![v]?.mutuallyExclusive
-      );
-      if (item.value.includes(idx)) {
-        item.value.splice(item.value.indexOf(idx), 1);
-      } else {
-        item.value = [...new Set([...item.value, idx])];
-      }
-    }
-  }
-  reply(item);
-};
-// 矩阵题选择
-const checkMatrix = (item: any, rowIdx: number, colIdx: number) => {
-  emits("checkMatrix", item, rowIdx, colIdx);
-};
-
-const inputBlur = () => {
-  // home.value.scrollTop = home.value.scrollHeight
-  window.scrollTo(0, document.querySelector(".home")?.scrollHeight || 0);
-};
-const skip = (item: any) => {
-  item.value = null;
-  emits("skip", item);
-};
-const back = (item: any) => {
-  emits("back", item);
-};
-const check = (item: any, flag: boolean) => {
-  emits("check", item, flag);
-};
-
-const checkReply = (item: any) => {
-  if (item.type === QUESTION_TYPE_MATRIX) {
-    return true;
-  } else if (item["choices"]?.length) {
-    if (
-      (!item.value && item.value !== 0) ||
-      (Array.isArray(item.value) && !item.value.length)
-    ) {
-      ElMessage.error("请选择");
-      replyLock.value = false;
-      return false;
-    }
-  } else {
-    if (!item.value && item.value !== 0) {
-      ElMessage.error(
-        `请${item.type === QUESTION_TYPE_DATE ? "选择" : "填写内容"}后提交`
-      );
-      replyLock.value = false;
-      return false;
-    }
-  }
-  return true;
-};
-
-const fetchSearchList = async (urlType = "disease") => {
-  const urls = {
-    disease: `/archivesServiceV2/api/extra/disease/list`,
-    medicine: `/archivesServiceV2/api/extra/medicine/list`
-  };
-  const { data } = (await request.get(urls[urlType])) as any;
-  const ids = item.value.cacheSearchList.map(v => v.id);
-  let list = [
-    ...item.value.cacheSearchList,
-    ...data.list.filter(v => !ids.includes(v.id))
-  ];
-  console.log("fetchSearchList", list);
-
-  list = item.value.systemTagIds?.length
-    ? list.filter(
-        v =>
-          !v.systemTags.length ||
-          !!v.systemTags?.find(tag => item.value.systemTagIds.includes(tag.id))
-      )
-    : list;
-  console.log("fetchSearchList system", list);
-  if (item.value.value && !list?.find(v => v.name == item.value.value)) {
-    list = [
-      {
-        sn: "extra",
-        name: item.value.value
-      },
-      ...list
-    ];
-  }
-  item.value.searchList = list;
-};
-
-const reply = (item: any) => {
-  emits("reply", item);
-};
-const repeat = (item: any) => {
-  item.showAdd = false;
-  emits("repeat", item);
-};
-const selectRef = ref();
-const cancelReadOnly = function (value: boolean) {
-  console.log("cancelReadOnly");
-
-  nextTick(() => {
-    !value && clearSelectReadOnly();
-  });
-};
-const clearSelectReadOnly = () => {
-  const input = selectRef.value?.querySelector(".el-input__inner");
-  input?.removeAttribute("readonly");
-};
-onMounted(() => {
-  init();
-  nextTick(() => {
-    selectRef.value && clearSelectReadOnly();
-  });
-});
-
-const selectVisible = ref(false);
-const selectKeyword = ref();
-const selectOptions = ref([]);
-const selectChecked = ref([]);
-const selectItemChange = selectItem => {
-  if (selectChecked.value.find(v => v.id == selectItem.id)) {
-    selectChecked.value.splice(
-      selectChecked.value.findIndex(v => v == selectItem.id),
-      1
-    );
-  } else {
-    if (item.value.config.isMultiple) {
-      selectChecked.value.push(selectItem);
-    } else {
-      selectChecked.value = [selectItem];
-    }
-  }
-};
-const searchSelectOptions = async () => {
-  const { data } = (await request.get(`/graphService/open/node/paginate`, {
-    params: {
-      page: 1,
-      pageSize: 999,
-      tag: item.value.config.sourceTag,
-      name: selectKeyword.value
-    }
-  })) as any;
-  selectOptions.value = data.list.sort(
-    (a, b) => a.properties?.name?.length - b.properties?.name?.length
-  );
-  //   .map(v => {
-  //   v.matchRate = selectKeyword.value.length / v.properties?.name?.length
-  //   return v
-  // })
-};
-
-const throttleSearch = throttle(searchSelectOptions, 300);
-const saveSelect = () => {
-  if (
-    !selectChecked.value.length &&
-    selectKeyword.value &&
-    item.value.config.isAppendNull
-  ) {
-    selectChecked.value.push({
-      id: "",
-      properties: {
-        name: selectKeyword.value
-      }
-    });
-  }
-  item.value.value = selectChecked.value.map(v => {
-    return {
-      key: v.id,
-      value: v.properties?.name
-    };
-  });
-  reply(item.value);
-  selectVisible.value = false;
-  selectOptions.value = [];
-  selectKeyword.value = "";
-};
-const openSelect = () => {
-  if (item.value.value) {
-    selectChecked.value = item.value.value.map(v => {
-      return {
-        id: v.key,
-        properties: {
-          name: v.value
-        }
-      };
-    });
-  }
-  selectVisible.value = true;
-};
-</script>
-
-<style lang="scss">
-.survey-matrix-container {
-  overflow-x: auto;
-  padding: 10px 0;
-  .survey-matrix {
-    font-size: 12px;
-    border-collapse: collapse;
-    margin: 0 auto;
-    min-width: 100%;
-    th,
-    td {
-      border: 1px solid #ccc;
-      padding: 8px 10px;
-      text-align: center;
-    }
-    th {
-      white-space: nowrap;
-    }
-    tr {
-      td:first-of-type {
-        font-weight: bold;
-        white-space: nowrap;
-      }
-    }
-  }
-}
-.confirm-input-btn {
-  &:not(:last-of-type) {
-    margin-right: 10px;
-  }
-}
-</style>

+ 0 - 178
src/views/dataCenter/components/UploadDataDialog.vue

@@ -1,178 +0,0 @@
-<template>
-  <el-dialog
-    v-model="visible"
-    :title="tabs[tabActive]?.label || '上传数据'"
-    width="80%"
-  >
-    <div v-show="tabActive < 0">
-      <div
-        v-for="(item, index) in tabs"
-        :key="index"
-        class="shadow rounded-md mb-4 p-4 hover:bg-gray-50 cursor-pointer flex items-center"
-        :class="{ 'bg-gray-50': tabActive === index }"
-        @click="changeTab(index)"
-      >
-        <img :src="item.icon" alt="" class="w-12 mr-1" />
-        <div>
-          <div
-            class="text-base font-bold"
-            :class="{
-              'text-blue-500': tabActive === index
-            }"
-          >
-            {{ item.label }}
-          </div>
-          <div class="text-sm text-gray-500">{{ item.tip }}</div>
-        </div>
-      </div>
-    </div>
-    <div v-show="tabActive >= 0">
-      <el-button type="primary" link class="mb-4" @click="tabActive = -1"
-        >返回重新选择</el-button
-      >
-      <component
-        v-if="tabs[tabActive]?.component"
-        :is="tabs[tabActive].component"
-      ></component>
-    </div>
-    <!-- <el-tabs v-model="tabActive" type="card">
-      <el-tab-pane
-        v-for="(item, index) in tabs"
-        :key="index"
-        :label="item.label"
-        lazy
-        :name="index"
-      >
-        <component v-if="item.component" :is="item.component"></component>
-        <el-empty v-else description="开发中"></el-empty>
-      </el-tab-pane>
-    </el-tabs> -->
-  </el-dialog>
-</template>
-
-<script setup>
-import {
-  computed,
-  ref,
-  shallowRef,
-  provide,
-  inject,
-  defineAsyncComponent
-} from "vue";
-import { request } from "@/utils";
-import { usePermissionStoreHook } from "@/store/modules/permission";
-import monitoring from "@/assets/icon-upload-monitoring.png";
-import residents from "@/assets/icon-upload-residents.png";
-import iconReturn from "@/assets/icon-upload-return.png";
-import iconCheckData from "@/assets/icon-checkdata.png";
-import visits from "@/assets/icon-upload-visits.png";
-import physical from "@/assets/icon-upload-physical.png";
-import { useRoute, useRouter } from "vue-router";
-const [route, router] = [useRoute(), useRouter()];
-
-const defaultArchivesId = inject("defaultArchivesId") || "";
-const props = defineProps({
-  visible: {
-    type: Boolean,
-    default: false
-  }
-});
-const emits = defineEmits(["update:visible"]);
-const visible = computed({
-  get() {
-    return props.visible;
-  },
-  set(v) {
-    emits("update:visible", v);
-  }
-});
-provide("closeUploadDialog", () => {
-  visible.value = false;
-});
-const tabActive = ref(-1);
-const tabs = ref([
-  //   , {
-  //   label: '门诊记录',
-  //   component: null
-  // }, {
-  //   label: '住院记录',
-  //   component: null
-  // }, {
-  //   label: '手动录入',
-  //   component: null
-  // }
-]);
-const changeTab = index => {
-  if (tabs.value[index].externalLink) {
-    return router.push({
-      path: tabs.value[index].externalLink,
-      query: {
-        archivesId: defaultArchivesId.value
-      }
-    });
-  }
-  tabActive.value = index;
-};
-const permissions = shallowRef([]);
-const getPermissions = async () => {
-  const { data } = await request.get(`/mechanismService/mechanism/profile`);
-  permissions.value = data.profile?.permissions || [];
-
-  if (permissions.value.includes("data:upload:medicalReport")) {
-    tabs.value.push({
-      label: "检查报告",
-      tip: "需要上传原始数据资料,原始数据资料支持PDF或图片(JPG、JPEG、PNG)格式",
-      icon: physical,
-      component: defineAsyncComponent(() => import("./MedicalReportUpload.vue"))
-    });
-  }
-  if (permissions.value.includes("data:upload:visitRecord")) {
-    tabs.value.push({
-      label: "巡访数据",
-      tip: "需要上传原始数据资料,原始数据资料支持PDF或图片(JPG、JPEG、PNG)格式",
-      icon: visits,
-      component: defineAsyncComponent(() => import("./VisitsDataUpload.vue"))
-    });
-  }
-  if (permissions.value.includes("data:upload:inspectData")) {
-    tabs.value.push({
-      label: "检查数据",
-      tip: "手动录入检查数据,可上传原始数据资料,原始数据资料支持PDF或图片(JPG、GPEG、PNG)格式",
-      icon: iconCheckData,
-      externalLink: "/data/uploadCheckData"
-    });
-  }
-  if (permissions.value.includes("data:upload:demand")) {
-    tabs.value.push({
-      label: "居民需求",
-      tip: "需要上传原始数据资料,原始数据资料支持PDF或图片(JPG、JPEG、PNG)格式",
-      icon: residents,
-      component: defineAsyncComponent(() => import("./NeedsUpload.vue"))
-    });
-  }
-
-  if (permissions.value.includes("data:upload:dailyMonitor")) {
-    tabs.value.push({
-      label: "日常监测数据",
-      tip: "如血压、血糖等数据。可上传原始数据资料,原始数据资料支持PDF或图片(JPG、JPEG、PNG)格式",
-      icon: monitoring,
-      component: defineAsyncComponent(() =>
-        import("./MonitoringDataUpload.vue")
-      )
-    });
-  }
-  if (permissions.value.includes("data:upload:diseaseVisit")) {
-    tabs.value.push({
-      label: "回访数据",
-      tip: "如疾病或者其他回访记录。可上传原始数据资料,原始数据资料支持PDF或图片(JPG、JPEG、PNG)格式",
-      icon: iconReturn,
-      component: defineAsyncComponent(() =>
-        import("./DiseaseVisitDataUpload.vue")
-      )
-    });
-  }
-};
-getPermissions();
-</script>
-
-<style lang="scss" scoped></style>

+ 0 - 342
src/views/dataCenter/components/VisitsDataUpload.vue

@@ -1,342 +0,0 @@
-<template>
-  <div>
-    <div class="flex items-center mb-2">
-      <span>需要上传原始数据和文件</span>
-      <el-switch v-model="needUpload"></el-switch>
-    </div>
-
-    <template v-if="needUpload">
-      <div
-        v-for="(item, index) in list"
-        :key="index"
-        class="rounded border border-solid border-gray-100 p-4 mb-4"
-      >
-        <div
-          class="flex justify-between items-center pb-4 mb-2 border-0 border-b border-solid border-gray-100"
-        >
-          <div>
-            <span>关联的档案号(选填):</span>
-            <SearchArchivesSelect
-              v-model="item.archivesId"
-              :disabled="!!defaultArchivesId"
-            ></SearchArchivesSelect>
-          </div>
-          <el-upload
-            :ref="r => appendUploadRefs.push(r)"
-            action="#"
-            multiple
-            :auto-upload="false"
-            :show-file-list="false"
-            :on-change="
-              (file, files) => appendFileChange(file, files, item, index)
-            "
-          >
-            <template #trigger>
-              <el-button type="primary">上传文件</el-button>
-            </template>
-          </el-upload>
-          <el-popconfirm title="是否确定删除?" @confirm="list.splice(index, 1)">
-            <template #reference>
-              <el-button type="danger" link>删除该批次</el-button>
-            </template>
-          </el-popconfirm>
-        </div>
-        <div>
-          <el-table :data="item.files">
-            <el-table-column label="文件名" prop="fileName"></el-table-column>
-            <el-table-column label="数据发生日期(必填)">
-              <template #default="{ row }">
-                <el-date-picker
-                  v-model="row.date"
-                  type="date"
-                  placeholder="请选择日期"
-                  format="YYYY-MM-DD"
-                  value-format="YYYY-MM-DD"
-                :disabled-date="disabledDate"
-                />
-              </template>
-            </el-table-column>
-            <el-table-column label="操作">
-              <template #default="{ row, $index }">
-                <el-popconfirm
-                  title="是否确定删除?"
-                  @confirm="item.files.splice($index, 1)"
-                >
-                  <template #reference>
-                    <el-button type="danger" link>删除</el-button>
-                  </template>
-                </el-popconfirm>
-              </template>
-            </el-table-column>
-          </el-table>
-        </div>
-      </div>
-      <div class="flex items-center">
-        <el-select v-model.number="uploadType">
-          <el-option label="新增单人数据" :value="0"></el-option>
-          <el-option label="新增多人数据" :value="1"></el-option>
-        </el-select>
-        <el-upload
-          ref="uploadRef"
-          v-model:file-list="uploadFiles"
-          action="#"
-          multiple
-          :auto-upload="false"
-          :show-file-list="false"
-          :on-change="uploadChange"
-        >
-          <template #trigger>
-            <el-button type="primary" class="ml-4">新增</el-button>
-          </template>
-        </el-upload>
-      </div>
-      <div>
-        <div class="my-2 text-red-500 text-xs">
-          新增单人数据时,如果上传了多份文件,那么这些文件都会放入同一个数据批次中
-        </div>
-        <div class="my-2 text-red-500 text-xs">
-          新增多人数据时,如果上传了多份文件,那么每一份文件都会创建一个独立的数据批次,您可以在每一个独立数据批次里面去追加单人的补充文件数据
-        </div>
-      </div>
-      <div class="text-right">
-        <el-button
-          type="primary"
-          :disabled="uploadLock"
-          @click="createUploadTask"
-          >保存并开始上传</el-button
-        >
-      </div>
-    </template>
-    <template v-else>
-      <el-form :inline="true">
-        <el-form-item label="关联的档案号" required>
-          <SearchArchivesSelect
-            v-model="archivesId"
-            :disabled="!!defaultArchivesId"
-          ></SearchArchivesSelect>
-        </el-form-item>
-        <el-form-item label="选择回访数据" required>
-          <el-select
-            v-model="formId"
-            :disabled="!archivesId"
-            filterable
-            clearable
-            @change="formChange"
-            @clear="form = undefined"
-          >
-            <el-option
-              v-for="(item, index) in formList"
-              :key="index"
-              :label="item.formTitle"
-              :value="item.formId"
-            ></el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="选择日期" required>
-          <el-date-picker
-            v-model="date"
-            type="datetime"
-            placeholder="请选择日期"
-            format="YYYY-MM-DD HH:mm:ss"
-            value-format="YYYY-MM-DD HH:mm:ss"
-                :disabled-date="disabledDate"
-          />
-        </el-form-item>
-      </el-form>
-      <div>
-        <ArchivesModule is-plat :module-id="formId" :form="form" />
-      </div>
-      <div class="text-right mt-4">
-        <el-button
-          type="primary"
-          :disabled="!form && !transferRawJson.length"
-          @click="submitFormData"
-          >保存并开始上传</el-button
-        >
-      </div>
-    </template>
-  </div>
-</template>
-
-<script setup>
-import { ElMessage, ElLoading } from "element-plus";
-import { ref, inject, shallowRef, provide } from "vue";
-import dayjs from "dayjs";
-import { uploadToOSS, debounce, request, disabledDate } from "@/utils";
-import ArchivesModule from "./ArchivesModule.vue";
-
-import SearchArchivesSelect from "@/components/Archives/SearchArchivesSelect.vue";
-const getDataList = inject("getList");
-const closeUploadDialog = inject("closeUploadDialog");
-
-const needUpload = ref(false);
-const defaultArchivesId = inject("defaultArchivesId") || "";
-const list = ref([]);
-// uploadToOSS()
-const uploadType = ref(0);
-const uploadRef = ref();
-const uploadFiles = ref([]);
-const uploadChange = debounce((file, files) => {
-  console.log(uploadFiles.value, file, files);
-  if (uploadType.value) {
-    files.forEach(f => {
-      list.value.push({
-        type: uploadType.value,
-        archivesId: defaultArchivesId.value || "",
-        files: [
-          {
-            raw: f.raw,
-            fileName: f.name,
-            date: "",
-            fileUrl: "",
-            remark: ""
-          }
-        ]
-      });
-    });
-  } else {
-    list.value.push({
-      type: uploadType.value,
-      files: files.map(f => ({
-        raw: f.raw,
-        fileName: f.name,
-        date: "",
-        fileUrl: "",
-        remark: ""
-      })),
-      archivesId: defaultArchivesId.value || ""
-    });
-  }
-  uploadRef.value.clearFiles();
-}, 1e2);
-const appendUploadRefs = ref([]);
-const appendFileChange = debounce((file, files, item, index) => {
-  console.log(files, item);
-  console.log(appendUploadRefs.value[index]);
-  files.forEach(f => {
-    item.files.push({
-      raw: f.raw,
-      fileName: f.name,
-      date: "",
-      fileUrl: "",
-      remark: ""
-    });
-  });
-  appendUploadRefs.value.forEach(v => {
-    v.clearFiles && v.clearFiles();
-  });
-}, 1e2);
-
-const uploadLock = ref(false);
-const createUploadTask = async () => {
-  uploadLock.value = true;
-
-  const uploadFileTotal = list.value.reduce((a, b) => a + b.files.length, 0);
-  console.log(uploadFileTotal);
-  if (!uploadFileTotal) return ElMessage.error("请新增数据后保存");
-  if (
-    uploadFileTotal !=
-    list.value
-      .map(v => v.files.map(f => f.date))
-      .flat()
-      .filter(v => v).length
-  ) {
-    uploadLock.value = false;
-    return ElMessage.error("请填写所有文件的发生日期");
-  }
-  const loading = ElLoading.service({
-    lock: true,
-    text: "开始上传",
-    background: "rgba(255, 255, 255, 0.7)"
-  });
-  try {
-    let uploadCount = 0;
-    for (const item of list.value) {
-      for (const v of item.files) {
-        v.fileUrl = await uploadToOSS(v.raw, v.fileName);
-        uploadCount++;
-        loading.text = `正在上传文件${uploadCount}/${uploadFileTotal}`;
-      }
-    }
-
-    loading.text = `批次处理中`;
-    await Promise.all(
-      list.value.map(item => {
-        return request.post(`/medicalData/create`, { ...item, type: 6 });
-      })
-    );
-    ElMessage.success("创建完成");
-    getDataList();
-    closeUploadDialog();
-  } catch (e) {
-    console.log(e);
-  }
-  uploadLock.value = false;
-  loading.close();
-};
-
-const archivesId = ref(defaultArchivesId.value || "");
-const date = ref(dayjs().format("YYYY-MM-DD HH:mm:ss"));
-const curNode = ref("");
-const nodes = shallowRef([]);
-const searchNodes = async () => {
-  const { data } = await request.get(`/graphService/open/node/paginate`, {
-    params: {
-      page: 1,
-      pageSize: 9999,
-      tag: "可回访"
-    }
-  });
-  nodes.value = data.list;
-};
-searchNodes();
-
-const formId = ref("");
-const form = ref();
-const formList = shallowRef([]);
-const transferRawJson = ref([]);
-provide("transferRawJson", transferRawJson);
-const getFormConfig = async v => {
-  const { data } = await request.get(`/idcService/mechanism/formConfig/get`);
-  formList.value = data.list;
-  formId.value = "";
-  form.value = undefined;
-};
-getFormConfig();
-const formChange = v => {
-  if (!formId.value) return;
-  // getFormDetail();
-  form.value = formList.value.find(item => item.formId === formId.value)?.form;
-};
-const submitSimpleFormData = async (answers, close) => {
-  console.log(answers);
-  const answersNo = answers.map(v => v.answer.questionNo);
-  transferRawJson.value = [
-    ...transferRawJson.value?.filter(
-      v => !answersNo.includes(v.answer.questionNo)
-    ),
-    ...answers
-  ];
-  close && close();
-};
-provide("submitSimpleFormData", submitSimpleFormData);
-const submitFormData = async () => {
-  const req = {
-    transferRawJson: JSON.stringify({
-      formId: formId.value,
-      diseaseId: curNode.value,
-      answers: transferRawJson.value
-    }),
-    type: 6,
-    archivesId: archivesId.value,
-    date: dayjs(date.value).format("YYYY-MM-DD HH:mm:ss")
-  };
-  console.log(req);
-  await request.post(`/medicalData/create`, req);
-  ElMessage.success("操作成功");
-  closeUploadDialog();
-  getDataList();
-};
-</script>
-
-<style lang="scss" scoped></style>

+ 0 - 78
src/views/dataCenter/components/VisitsFillData.vue

@@ -1,78 +0,0 @@
-
-<template>
-  <div class="h-full py-4 flex flex-col">
-    <el-select v-model="curForm" filterable class="mx-4" :disabled="formDisabled">
-      <el-option v-if="!formList[curForm]" :value="0" label="请选择表单"></el-option>
-      <el-option v-for="(item, index) in formList" :key="index" :label="item.formTitle" :value="index"></el-option>
-    </el-select>
-    <div class="w-full overflow-y-auto mt-4 flex-1">
-      <div v-if="formList[curForm]">
-        <ArchivesModule
-          ref="HealthyFileRef" is-plat
-          :module-id="formList[curForm].formId"
-          :form="formList[curForm].form"
-        />
-      </div>
-    </div>
-    <div class="p-4 flex justify-center items-center">
-      <el-button class="w-full" type="primary" :disabled="!formList[curForm]"	size="large" @click="submitFormData">保存</el-button>
-    </div>
-  </div>
-</template>
-<script setup>
-
-import { computed, ref, shallowRef, provide, nextTick, watch, inject, defineAsyncComponent } from 'vue';
-
-import { request, parseJsonData } from "@/utils";
-
-import ArchivesModule from './ArchivesModule.vue';
-import { ElMessage } from 'element-plus';
-
-const curForm = ref(0)
-const formDisabled = ref(false)
-const formList = shallowRef([])
-const getFormConfig = async () => {
-  const { data } = await request.get(`/idcService/mechanism/formConfig/get`)
-  formList.value = data.list
-  if (formId.value) {
-    const idx = formList.value.findIndex(v => v.formId == formId.value)
-    if (idx >= 0 && transferRawJson.value) {
-      curForm.value = idx
-      formDisabled.value = true
-    }
-  }
-}
-
-const transferRawJson = inject('transferRawJson')
-const formId = inject('formId')
-getFormConfig()
-
-// const submitFormData = inject('submitFormData')
-
-const submitSimpleFormData = async (answers, close) => {
-  const answersNo = answers.map(v => v.answer.questionNo)
-  transferRawJson.value = [...transferRawJson.value?.filter(v => !answersNo.includes(v.answer.questionNo)), ...answers]
-  close && close()
-}
-provide('submitSimpleFormData', submitSimpleFormData)
-const sn = inject('sn')
-const submitFormData = async () => {
-  const req = {
-    sn,
-    data: {
-      formId: formList.value[curForm.value].formId,
-      answers: transferRawJson.value
-    }
-  }
-  console.log(req)
-  await request.post(`/idcService/mechanism/medicalData/update/transferResult`, req)
-  ElMessage.success('操作成功')
-  formDisabled.value = true
-  // getDetail()
-}
-</script>
-
-<style lang='scss' scoped>
-
-</style>
-

+ 0 - 165
src/views/dataCenter/dataSet.vue

@@ -1,165 +0,0 @@
-<template>
-  <div>
-    <el-card shadow="never">
-      <div>
-        <el-row>
-          <el-col class="" :span="6">
-            <el-button type="primary" @click="state.visibleAdd = true"
-              >新增数据集</el-button
-            >
-          </el-col>
-          <el-col :span="18">
-            <div class="text-right">
-              <el-input
-                style="width: 500px"
-                class="ml-2"
-                v-model="state.query.name"
-                placeholder="搜索名称"
-                clearable
-              ></el-input>
-              <el-button class="ml-2" type="primary" @click="handleSearch"
-                >查询</el-button
-              >
-            </div>
-          </el-col>
-        </el-row>
-      </div>
-    </el-card>
-    <el-card shadow="never" class="mt-4">
-      <el-table :data="state.tableData" style="width: 100%">
-        <el-table-column prop="name" label="数据集名称"> </el-table-column>
-        <el-table-column prop="createdAt" label="数据上传时间">
-        </el-table-column>
-        <el-table-column prop="fileCount" label="上传文件数"> </el-table-column>
-        <el-table-column prop="userCount" label="包含用户数"> </el-table-column>
-        <el-table-column prop="itemCount" label="包含检查项目数">
-        </el-table-column>
-        <el-table-column label="操作" #default="{ row }">
-          <el-button type="primary" link @click="handleViewData(row)"
-            >查看数据</el-button
-          >
-          <el-button type="primary" link @click="handleReportData(row)"
-            >上报数据</el-button
-          >
-          <el-button type="primary" link @click="handleRegister(row)"
-            >档案注册</el-button
-          >
-          <el-button type="primary" link @click="handleRelevance(row)"
-            >数据关联</el-button
-          >
-
-          <el-popconfirm
-            title="确定要删除这个数据集吗?删除后整理的数据都将被删除"
-            @confirm="handleDelete(row.id)"
-          >
-            <template #reference>
-              <el-button type="danger" link>删除</el-button>
-            </template>
-          </el-popconfirm>
-        </el-table-column>
-      </el-table>
-      <el-pagination
-        class="justify-end mt-4"
-        :current-page="state.query.page"
-        :page-size="state.query.pageSize"
-        :total="state.total"
-        background
-        layout="total, prev, pager, next, jumper"
-        @current-change="
-          page => {
-            state.query.page = page;
-            getList();
-          }
-        "
-      ></el-pagination>
-    </el-card>
-    <DialogAddDataSet
-      v-model:show="state.visibleAdd"
-      @success="handleSearch"
-    ></DialogAddDataSet>
-    <DialogReportData
-      v-model:show="state.visibleReportData"
-      :id="state.rowData.id"
-    ></DialogReportData>
-    <DialogRegisterData
-      v-model:show="state.visibleRegisterData"
-      :id="state.rowData.id"
-    >
-    </DialogRegisterData>
-    <DialogViewData
-      v-model:show="state.visibleViewData"
-      :id="state.rowData.id"
-    ></DialogViewData>
-    <DialogRelevance
-      v-model:show="state.visibleRelevance"
-      :id="state.rowData.id"
-    ></DialogRelevance>
-  </div>
-</template>
-<script lang="ts" setup>
-import { ref, reactive } from "vue";
-import DialogAddDataSet from "./components/DialogAddDataSet.vue";
-import DialogReportData from "@/views/dataCenter/components/DialogReportData.vue";
-import DialogViewData from "./components/DialogViewData.vue";
-import DialogRegisterData from "./components/DialogRegisterData.vue";
-import DialogRelevance from "./components/DialogRelevance.vue";
-
-import { request } from "@/utils";
-import { ElMessage } from "element-plus";
-
-const state = reactive({
-  visibleAdd: false,
-  visibleReportData: false,
-  visibleViewData: false,
-  visibleRegisterData: false,
-  visibleRelevance: false,
-  query: {
-    name: "",
-    page: 1,
-    pageSize: 15
-  },
-  tableData: [],
-  total: 0,
-  rowData: {}
-});
-const handleReportData = row => {
-  state.visibleReportData = true;
-  state.rowData = row;
-};
-const handleRegister = row => {
-  state.rowData = row;
-  state.visibleRegisterData = true;
-};
-const handleSearch = () => {
-  state.query.page = 1;
-  getList();
-};
-const handleViewData = row => {
-  state.rowData = row;
-  state.visibleViewData = true;
-};
-const handleRelevance = row => {
-  state.rowData = row;
-  state.visibleRelevance = true;
-};
-const getList = () => {
-  request
-    .get("/dataService/dataParse/mechanism/parsed/paginate", {
-      params: state.query
-    })
-    .then(resp => {
-      state.tableData = resp.data.list;
-      state.total = resp.data.total;
-    });
-};
-const handleDelete = id => {
-  request
-    .post("/dataService/dataParse/mechanism/parsed/delete", {
-      id
-    })
-    .then(resp => {
-      ElMessage.success(resp.message);
-    });
-};
-getList();
-</script>

+ 0 - 511
src/views/dataCenter/template.vue

@@ -1,511 +0,0 @@
-<template>
-  <div class="page-calibration-ocr">
-    <div class="mb-2 flex items-center justify-between">
-      <div>
-        <el-button type="primary" class="ml-2 mr-4" @click="editItem()"
-          >添加</el-button
-        >
-        <el-button
-          type="primary"
-          plain
-          class="ml-2 mr-4"
-          @click="showAgencyDialog"
-          >检查机构管理</el-button
-        >
-      </div>
-      <div>
-        <el-input
-          v-model="filter.name"
-          class="w-64 mx-2"
-          placeholder="请输入名称"
-          clearable
-          @keyup.enter.native="onSearch"
-        ></el-input>
-        <el-button :icon="Search" type="primary" @click="onSearch"
-          >搜索</el-button
-        >
-      </div>
-    </div>
-    <el-row class="py-4">
-      <el-col :span="24">
-        <el-table :data="list">
-          <el-table-column
-            label="模板名称"
-            prop="templateName"
-          ></el-table-column>
-          <el-table-column
-            label="所属机构"
-            prop="institutionName"
-          ></el-table-column>
-          <el-table-column label="操作">
-            <template #default="{ row }">
-              <el-button type="primary" link @click="editItem(row)"
-                >编辑</el-button
-              >
-              <el-button type="danger" link @click="removeItem(row)"
-                >删除</el-button
-              >
-            </template>
-          </el-table-column>
-        </el-table>
-        <el-pagination
-          class="mt-4 justify-end"
-          background
-          @current-change="onPageChange"
-          :current-page.sync="filter.page"
-          layout="total, prev, pager, next"
-          :total="count"
-        >
-        </el-pagination>
-      </el-col>
-    </el-row>
-    <el-dialog v-model="editTemplateVisible" title="编辑模板" width="80%">
-      <el-form label-position="top">
-        <el-form-item label="检查机构" required>
-          <!-- 虚拟滚动机构列表 getAgencyFillList -->
-          <el-select-v2
-            v-model="editTemplate.institutionId"
-            placeholder="请选择"
-            filterable
-            :options="agencyFillList"
-            :props="{
-              label: 'institutionName',
-              value: 'id'
-            }"
-          />
-          <!-- <el-select
-            v-model="editTemplate.agencyId"
-            placeholder="请选择检查机构"
-            filterable
-            clearable
-            @change="getAgencyFillList"
-          >
-            <el-option
-              v-for="item in agencyList"
-              :key="item.id"
-              :label="item.name"
-              :value="item.id"
-            ></el-option>
-          </el-select> -->
-        </el-form-item>
-        <el-form-item label="模板名称" required>
-          <el-input
-            v-model="editTemplate.name"
-            placeholder="请输入模板名称"
-          ></el-input>
-        </el-form-item>
-        <el-form-item label="模板项目" required>
-          <el-table :data="editTemplate.list">
-            <el-table-column label="项目名称(必填)">
-              <template #default="{ row }">
-                <el-input v-model="row.name"></el-input>
-              </template>
-            </el-table-column>
-            <el-table-column label="默认结果">
-              <template #default="{ row }">
-                <el-input v-model="row.defaultValue"></el-input>
-              </template>
-            </el-table-column>
-            <el-table-column label="单位">
-              <template #default="{ row }">
-                <el-input v-model="row.unit"></el-input>
-              </template>
-            </el-table-column>
-            <el-table-column label="范围">
-              <template #default="{ row }">
-                <el-input v-model="row.scope"></el-input>
-              </template>
-            </el-table-column>
-            <el-table-column label="排序">
-              <template #default="{ row }">
-                <el-input v-model.number="row.sort"></el-input>
-              </template>
-            </el-table-column>
-            <el-table-column label="身体物质/部位(必填)">
-              <template #default="{ row }">
-                <el-select
-                  v-model="row.node"
-                  placeholder="请输入搜索后选择"
-                  filterable
-                  clearable
-                  remote
-                  :remote-method="query => searchBodyNodes(query, row)"
-                  @change="matchNodeChange(row, $event)"
-                >
-                  <el-option
-                    v-for="(node, nodeIdx) in row.nodes"
-                    :key="node.id"
-                    :label="node.properties?.name"
-                    :value="node.id"
-                    class="h-auto"
-                  >
-                    <div class="">
-                      <div>{{ node.properties?.name }}</div>
-                      <div v-if="node.matched" class="text-gray-500 text-xs">
-                        匹配名称:{{ node.matched }}
-                      </div>
-                    </div>
-                  </el-option>
-                </el-select>
-              </template>
-            </el-table-column>
-            <el-table-column label="检查项目(必填)">
-              <template #default="{ row }">
-                <el-select
-                  v-model="row.project"
-                  placeholder="请输入搜索后选择"
-                  filterable
-                  clearable
-                  remote
-                  :disabled="!row.node"
-                >
-                  <el-option
-                    v-for="(project, projectIdx) in row.projects"
-                    :key="project.id"
-                    :label="project.properties?.name"
-                    :value="project.id"
-                    class="h-auto"
-                  >
-                    <div class="">
-                      <div>{{ project.properties?.name }}</div>
-                      <div v-if="project.matched" class="text-gray-500 text-xs">
-                        匹配名称:{{ project.matched }}
-                      </div>
-                    </div>
-                  </el-option>
-                </el-select>
-              </template>
-            </el-table-column>
-            <el-table-column label="操作">
-              <template #default="{ row, $index }">
-                <el-button
-                  type="danger"
-                  link
-                  @click="
-                    removeEditTemplateItem(editTemplate.list.splice($index, 1))
-                  "
-                  >删除</el-button
-                >
-              </template>
-            </el-table-column>
-          </el-table>
-          <div class="mt-2">
-            <el-button type="primary" link @click="appendEditTemplateItem">
-              + 新增</el-button
-            >
-          </div>
-        </el-form-item>
-      </el-form>
-      <template #footer>
-        <el-button type="primary" @click="saveEditTemplate">保存</el-button>
-      </template>
-    </el-dialog>
-
-    <el-dialog v-model="agencyVisible" title="检查机构管理">
-      <el-form inline>
-        <el-form-item label="检查机构名称">
-          <el-input v-model="appendAgencyName" placeholder="请输入机构名称">
-          </el-input>
-        </el-form-item>
-        <el-form-item>
-          <el-button
-            type="primary"
-            :disabled="!appendAgencyName"
-            @click="appendAgency"
-            >添加</el-button
-          >
-        </el-form-item>
-      </el-form>
-      <el-divider></el-divider>
-      <el-table :data="agencyList">
-        <el-table-column label="机构名称">
-          <template #default="{ row }">
-            <el-input
-              v-model="row.institutionName"
-              @blur="editAgencyName(row)"
-            ></el-input>
-          </template>
-        </el-table-column>
-        <el-table-column label="操作" width="120">
-          <template #default="{ row }">
-            <el-button type="danger" link @click="removeAgency(row)"
-              >删除</el-button
-            >
-          </template>
-        </el-table-column>
-      </el-table>
-      <!-- 分页 -->
-      <el-pagination
-        class="mt-2 justify-end"
-        :current-page="agencyQuery.page"
-        :page-size="agencyQuery.pageSize"
-        layout="total, prev, pager, next, jumper"
-        :total="agencyTotal"
-        @current-change="
-          p => {
-            agencyQuery.page = p;
-            getAgencyList();
-          }
-        "
-      ></el-pagination>
-    </el-dialog>
-  </div>
-</template>
-<script setup>
-import { ref, onMounted, nextTick } from "vue";
-import { request } from "@/utils";
-import { Search } from "@element-plus/icons-vue";
-import { ElMessage, ElMessageBox } from "element-plus";
-const filter = ref({
-  name: "",
-  page: 1,
-  pageSize: 10
-});
-const list = ref([]);
-
-const count = ref(0);
-const onPageChange = page => {
-  filter.value.page = page;
-  getList();
-};
-const onSearch = () => {
-  filter.value.page = 1;
-  getList();
-};
-
-const getList = async () => {
-  const { data } = await request.get(
-    `/dataService/dataTemplate/mechanism/paginate`,
-    {
-      params: filter.value
-    }
-  );
-  list.value = data.list;
-  count.value = data.total;
-};
-const editItem = async row => {
-  if (row) {
-    const { data } = await request.get(`/dataService/dataTemplate/mechanism`, {
-      params: {
-        id: row.id
-      }
-    });
-    editTemplate.value.id = row.id;
-    editTemplate.value.institutionId = row.institutionId;
-    editTemplate.value.name = data.templateName;
-    editTemplate.value.list = data.templateItems.map(v => {
-      return {
-        ...v,
-        node: v.body.id,
-        nodes: [v.body],
-        project: v.item.id,
-        projects: [v.item]
-      };
-    });
-  } else {
-    editTemplate.value = {
-      id: undefined,
-      name: "",
-      list: []
-    };
-  }
-  getAgencyFillList();
-  editTemplateVisible.value = true;
-};
-const removeItem = row => {
-  ElMessageBox.confirm("确定删除吗?", "提示", {
-    confirmButtonText: "确定",
-    cancelButtonText: "取消",
-    type: "warning"
-  }).then(
-    () => {
-      request
-        .post("/dataService/dataTemplate/delete", { id: row.id })
-        .then(response => {
-          getList();
-          ElMessage.success("删除成功");
-        });
-    },
-    () => {}
-  );
-};
-onMounted(() => {
-  getList();
-});
-
-const editTemplateVisible = ref(false);
-const editTemplate = ref({
-  id: undefined,
-  institutionId: "",
-  name: "",
-  list: []
-});
-const appendEditTemplateItem = () => {
-  editTemplate.value.list.push({
-    name: "",
-    defaultValue: "",
-    unit: "",
-    scope: "",
-    sort: 0,
-    node: "",
-    body: "",
-    nodes: [],
-    project: "",
-    item: "",
-    projects: []
-  });
-};
-
-const recognitionType = ["身体物质/部位", "医学检查项目"];
-const relatedRelationship = ["异常属于", "可检测"];
-const searchNodes = async (key = "", isAddSearch = true, opt) => {
-  if (!key) return;
-  const { data } = await request.get(`/graphService/open/node/paginate`, {
-    params: {
-      pageSize: 500,
-      name: key,
-      tag: recognitionType[
-        !isAddSearch && opt ? opt.type : addIndicatorType.value
-      ],
-      ...(!isAddSearch && opt ? opt.params || {} : {})
-    }
-  });
-  if (isAddSearch) {
-    addIndicatorQuery.value = "";
-    allIndicators.value = data.list;
-  }
-  return data.list || [];
-};
-const searchBodyNodes = async (key, row) => {
-  if (!key) return;
-  const nodes =
-    (await searchNodes(key, false, {
-      type: 0
-    })) || [];
-  const dataIds = nodes.map(v => v.id);
-  row.nodes = nodes;
-};
-
-const searchRelateNodes = async (id, relationship) => {
-  const { data } = await request.get(`/graphService/open/node/related`, {
-    params: { id, relationship: relatedRelationship[relationship] }
-  });
-  return data || [];
-};
-const matchNodeChange = async row => {
-  const projects = await searchRelateNodes(row.node, 1);
-  row.projects = projects;
-};
-const saveEditTemplate = async () => {
-  if (!editTemplate.value.name) return ElMessage.error("请填写模板名称");
-  if (!editTemplate.value.list.length) return ElMessage.error("请添加模板项目");
-  if (
-    editTemplate.value.list.filter(v => v.name && v.project && v.node).length !=
-    editTemplate.value.list.length
-  )
-    return ElMessage.error("请填写模板项目必填项");
-  await request.post(
-    `/dataService/dataTemplate/mechanism${
-      editTemplate.value.id ? "/update" : ""
-    }`,
-    {
-      id: editTemplate.value.id,
-      institutionId: editTemplate.value.institutionId,
-      templateName: editTemplate.value.name,
-      templateItems: editTemplate.value.list.map(v => {
-        const temp = { ...v };
-        temp.body = temp.nodes.find(n => n.id == temp.node);
-        delete temp.node;
-        delete temp.nodes;
-        temp.item = temp.projects.find(n => n.id == temp.project);
-        delete temp.project;
-        delete temp.projects;
-        return temp;
-      })
-    }
-  );
-  ElMessage.success("操作成功");
-  editTemplateVisible.value = false;
-  getList();
-};
-
-
-const agencyVisible = ref(false);
-const appendAgencyName = ref("");
-const agencyList = ref([]);
-const agencyTotal = ref(0);
-const agencyQuery = ref({
-  page: 1,
-  pageSize: 10,
-  name: ""
-});
-const showAgencyDialog = () => {
-  agencyVisible.value = true;
-  agencyQuery.value.page = 1;
-  agencyQuery.value.name = "";
-  getAgencyList();
-};
-const getAgencyList = async () => {
-  const { data } = await request.get(
-    `/dataService/dataTemplate/mechanism/institution/paginate`,
-    {
-      params: agencyQuery.value
-    }
-  );
-  agencyList.value = data.list.map(v => {
-    return {
-      ...v,
-      originName: v.institutionName
-    };
-  });
-  agencyTotal.value = data.total;
-};
-
-const appendAgency = async () => {
-  if (!appendAgencyName.value) return ElMessage.error("请填写机构名称");
-  await request.post(`/dataService/dataTemplate/mechanism/institution`, {
-    name: appendAgencyName.value
-  });
-  ElMessage.success("操作成功");
-  getAgencyList();
-  appendAgencyName.value = "";
-};
-const removeAgency = async row => {
-  ElMessageBox.confirm("确定删除吗?", "提示", {
-    type: "warning"
-  }).then(async () => {
-    await request.post(
-      "/dataService/dataTemplate/mechanism/institution/delete",
-      { id: row.id }
-    );
-    getAgencyList();
-    ElMessage.success("删除成功");
-  });
-};
-const editAgencyName = async row => {
-  if (row.originName == row.institutionName) return;
-  if (!row.institutionName) return ElMessage.error("请填写机构名称");
-  await request.post(`/dataService/dataTemplate/mechanism/institution/update`, {
-    id: row.id,
-    name: row.institutionName
-  });
-  ElMessage.success("操作成功");
-  getAgencyList();
-};
-
-const agencyFillList = ref([]);
-const getAgencyFillList = async () => {
-  const { data } = await request.get(
-    `/dataService/dataTemplate/mechanism/institution/paginate`,
-    {
-      params: {
-        page: 1,
-        pageSize: 1000
-      }
-    }
-  );
-  agencyFillList.value = data.list;
-};
-</script>
-
-<style lang="scss"></style>

+ 0 - 867
src/views/dataCenter/uploadCheckData.vue

@@ -1,867 +0,0 @@
-<template>
-  <div class="page-upload-check-data">
-    <div
-      class="text-sm text-gray-500 flex items-center flex-wrap space-x-2 mb-6 rounded bg-white p-4"
-    >
-      <span class="text-gray-600">上传检查数据</span>
-      <div class="flex items-center">
-        <div class="flex items-center justify-center">
-          <i class="text-red-500">*</i>
-        </div>
-        <span class="text-gray-600">关联的档案号:</span>
-        <SearchArchivesSelect
-          v-model="archivesId"
-          :disabled="!!route.query.archivesId || !!route.query.sn"
-        ></SearchArchivesSelect>
-      </div>
-      <el-button type="primary" @click="fileUploadDialogVisible = true"
-        >上传原始PDF或者图片(非必传)</el-button
-      >
-      <div class="flex items-center space-x-2">
-        <span class="text-gray-600">检查数据</span>
-        <el-select-v2
-          v-model="institutionId"
-          placeholder="请选择"
-          filterable
-          :options="agencyFillList"
-          :props="{
-            label: 'institutionName',
-            value: 'id'
-          }"
-          @change="agencyChange"
-        />
-        <el-select
-          v-model="templateId"
-          placeholder="请选择"
-          multiple
-          collapse-tags
-          filterable
-          :disabled="!institutionId"
-        >
-          <el-option
-            v-for="(item, index) in templateList"
-            :key="index"
-            :label="item.templateName"
-            :value="item.id"
-          ></el-option>
-        </el-select>
-        <el-button type="primary" @click="addTemplate">添加</el-button>
-      </div>
-      <div class="flex-1 flex items-center flex-wrap justify-end whitespace-nowrap">
-        <el-button @click="router.back()">返回</el-button>
-        <el-button type="primary" :disabled="!list.length" @click="save"
-          >保存并上传</el-button
-        >
-        <el-button
-          v-if="ocrDataErrList.length"
-          type="danger"
-          link
-          @click="ocrDataErrVisible = true"
-          >错误信息</el-button
-        >
-      </div>
-    </div>
-    <div class="flex" style="height: calc(100vh - 180px)">
-      <div v-if="layouts.length" class="h-full overflow-y-auto flex-1">
-        <div
-          v-for="(item, index) in layouts"
-          :key="index"
-          class="mb-2 rounded-b relative bg-white"
-        >
-          <div class="p-2 bg-white rounded-t">
-            <span class="text-gray-500 text-sm">第{{ index + 1 }}页</span>
-            <el-button
-              v-if="ocrStatus"
-              type="primary"
-              class="ml-4"
-              link
-              @click="item.layoutVisible = !item.layoutVisible"
-              >{{item.layoutVisible ? '返回展示原始内容' : '页面文字识别'}}</el-button
-            >
-          </div>
-          <div v-if="item.layoutVisible" class="space-y-2 p-4">
-            <div
-              v-for="(line, lineIdx) in item.layout"
-              :key="lineIdx"
-              class="space-x-2"
-            >
-              <span
-                v-for="(l, idx) in line"
-                :key="idx"
-                v-copy="l.label"
-                class="inline-block p-1 border border-solid border-gray-300 hover:bg-gray-100 text-gray-700 hover:text-gray-900 cursor-copy"
-                :class="
-                  [
-                    'border-red-300',
-                    'border-yellow-400',
-                    'border-emerald-300',
-                    'border-blue-300',
-                    'border-purple-300',
-                    'border-orange-300',
-                    'border-lime-300',
-                    'border-cyan-300',
-                    'border-pink-300',
-                    'border-rose-300'
-                  ][idx]
-                "
-                >{{ l.label }}</span
-              >
-            </div>
-          </div>
-          <img
-            :src="item.url"
-            alt=""
-            class="w-full h-fit"
-            :class="{
-              'hidden opacity-0 invisible': item.layoutVisible
-            }"
-          />
-        </div>
-      </div>
-      <div class="h-full overflow-y-auto flex-1">
-        <div
-          class="table-wrap bg-white mb-4 rounded p-4"
-          v-for="(item, index) in list"
-          :key="item.id"
-        >
-          <div class="table-toolbar flex items-center justify-between">
-            <div class="flex-1 px-4">
-              <span class="text-gray-500">{{ item.templateName }}</span>
-              <!-- <span class="text-xs text-white">{{ item.id }}</span> -->
-            </div>
-            <div class="space-x-4">
-              <el-date-picker
-                v-model="item.date"
-                type="datetime"
-                placeholder="请选择日期"
-                format="YYYY-MM-DD HH:mm:ss"
-                value-format="YYYY-MM-DD HH:mm:ss"
-
-                :disabled-date="disabledDate"
-              />
-              <el-popconfirm
-                title="是否确认删除?"
-                @confirm="list.splice(index, 1)"
-              >
-                <template #reference>
-                  <el-button type="danger">删除</el-button>
-                </template>
-              </el-popconfirm>
-            </div>
-          </div>
-          <ProofTable
-            v-model:info="list[index]"
-            v-model:edit="idEditView"
-            :idx="index"
-            :list="list"
-          />
-        </div>
-      </div>
-    </div>
-    <el-dialog
-      title="原始资料管理"
-      v-model="fileUploadDialogVisible"
-      width="30%"
-    >
-      <p class="text-lg font-semibold mb-2">选择上传的原始资料文件类型</p>
-      <p class="mb-2">
-        仅支持选择其中的1种类型上传,重新上传将会覆盖之前的数据
-      </p>
-      <!-- 上传按钮组 -->
-      <div class="mb-4">
-        <el-upload
-          v-if="!fileUploadType || fileUploadType == 1"
-          ref="uploadPDFRef"
-          v-model:file-list="files"
-          action="#"
-          class="mb-4"
-          :limit="1"
-          :on-exceed="handleExceed"
-          accept=".pdf"
-          :http-request="uploadPDF"
-          :show-file-list="false"
-        >
-          <template #trigger>
-            <el-button type="primary">上传PDF文件(仅支持上传1份)</el-button>
-          </template>
-        </el-upload>
-        <el-upload
-          v-if="!fileUploadType || fileUploadType == 2"
-          ref="uploadImgRef"
-          v-model:file-list="files"
-          action="#"
-          accept=".jpg,.png,.jpeg"
-          multiple
-          :http-request="uploadImages"
-          :show-file-list="false"
-        >
-          <template #trigger>
-            <el-button type="primary">上传图片文件(可上传多张)</el-button>
-          </template>
-        </el-upload>
-      </div>
-
-      <!-- 图片格式提示 -->
-      <p class="mb-4">图片类型支持常见的图片格式,如png,jpg,jpeg</p>
-
-      <!-- 删除按钮 -->
-      <el-popconfirm
-        title="是否确认删除?"
-        @confirm="
-          fileUploadType = 0;
-          fileUrls = [];
-          files = [];
-          layouts = [];
-        "
-      >
-        <template #reference>
-          <el-button type="danger">删除当前上传的文件</el-button>
-        </template>
-      </el-popconfirm>
-    </el-dialog>
-
-    <el-dialog v-model="ocrDataErrVisible" title="错误信息">
-      <div
-        v-for="(item, index) in ocrDataErrList"
-        :key="index"
-        class="border border-solid border-gray-200 rounded shadow-sm mb-4 p-4 space-y-2"
-      >
-        <div v-if="!item.errType && item.originalName">
-          <span class="font-bold text-base my-1 mr-2">检查名称:</span>
-          <el-tag type="warning">{{ item.originalName }}</el-tag>
-        </div>
-        <div v-if="!item.errType">
-          <span class="font-bold text-base my-1 mr-2">系统名称:</span>
-          <el-tag v-copy="item.nodeName" class="cursor-copy">{{ item.nodeName }}</el-tag>
-        </div>
-        <div>
-          <span class="font-bold text-base my-1 mr-2">错误信息:</span>
-          <div>
-            <div
-              v-for="(msg, msgIdx) in item.errMessage"
-              :key="msgIdx"
-              class="break-all whitespace-pre-wrap"
-            >
-              {{ msg }}
-            </div>
-          </div>
-        </div>
-      </div>
-    </el-dialog>
-  </div>
-</template>
-<script setup>
-import { ElMessage, ElMessageBox, genFileId } from "element-plus";
-import { ref, inject, shallowRef, defineAsyncComponent, provide } from "vue";
-import {
-  randomString,
-  uploadToOSS,
-  debounce,
-  sleep,
-  parseJSON,
-  request
-} from "@/utils";
-import dayjs from "dayjs";
-import SearchArchivesSelect from "@/components/Archives/SearchArchivesSelect.vue";
-import ProofTable from "./components/ProofTable.vue";
-
-import { useRoute, useRouter } from "vue-router";
-const [route, router] = [useRoute(), useRouter()];
-
-const list = ref([]);
-const archivesId = ref(route.query.archivesId || "");
-const institutionId = ref("");
-const templateId = ref([]);
-const idEditView = ref(true);
-
-const ocrStatus = ref();
-const getOcrStatus = async () => {
-  const { data } = await request.get("/ocrService/setting/ocr/status");
-  ocrStatus.value = data.ocr;
-};
-getOcrStatus();
-
-const disabledDate = d => {
-  const today = new Date();
-  today.setHours(23, 59, 59, 999);
-  return d.getTime() > today.getTime();
-};
-const groupItemsByDifference = (data, difference) => {
-  const result = [];
-  let currentRow = [];
-
-  // 按 t 值升序排序
-  data.sort((a, b) => a.t - b.t);
-
-  for (let i = 0; i < data.length; i++) {
-    const currentItem = data[i];
-
-    // 如果当前行为空,直接将当前项目加入到当前行
-    if (currentRow.length === 0) {
-      currentRow.push(currentItem);
-    } else {
-      // 计算当前项目与当前行最后一个项目的 t 值差值
-      const diff = currentItem.t - currentRow[currentRow.length - 1].t;
-
-      // 如果差值小于等于给定的差值,则将当前项目加入到当前行
-      if (diff <= difference) {
-        currentRow.push(currentItem);
-      } else {
-        // 如果差值大于给定的差值,则将当前行加入到结果数组,并重新开始新的一行
-        result.push(currentRow);
-        currentRow = [currentItem];
-      }
-    }
-  }
-
-  // 将最后一行加入到结果数组
-  if (currentRow.length > 0) {
-    result.push(currentRow);
-  }
-  // 在每一行中按照 l 值升序排序
-  result.forEach(row => {
-    row.sort((a, b) => a.l - b.l);
-  });
-
-  return result;
-};
-const layouts = ref([]);
-console.log(layouts.value);
-const ocrLayout = debounce(async () => {
-  if (!ocrStatus.value) return;
-  const { data } = await request.post("/ocrService/label/layout", {
-    urls: fileUrls.value.map(v => v.url),
-    batchId: ""
-  });
-  layouts.value = (data.layouts || []).map(page => {
-    let layout = page.layout[0].map(v => {
-      return {
-        label: v[1][0],
-        l: v[0][0][0],
-        t: v[0][0][1]
-      };
-    });
-    return {
-      ...page,
-      layoutVisible: false,
-      layout: groupItemsByDifference(layout, 12)
-    };
-  });
-}, 300);
-const ocrPageLayout = () => {};
-const files = ref([]);
-const fileUrls = ref([]);
-const fileUploadType = ref(0);
-const fileUploadDialogVisible = ref(false);
-const uploadPDFRef = ref();
-const handleExceed = files => {
-  uploadPDFRef.value.clearFiles();
-  const file = files[0];
-  file.uid = genFileId();
-  uploadPDFRef.value.handleStart(file);
-};
-const uploadPDF = async opt => {
-  fileUploadType.value = 1;
-  console.log(opt.file);
-  const url = await uploadToOSS(opt.file, opt.file.name);
-  files.value[0].url = url;
-  fileUrls.value = [
-    {
-      name: opt.file.name,
-      url
-    }
-  ];
-  fileUploadDialogVisible.value = false;
-  ocrLayout();
-};
-
-const uploadImgRef = ref();
-const uploadImages = async opt => {
-  fileUploadType.value = 2;
-  console.log(opt);
-
-  const url = await uploadToOSS(opt.file, opt.file.name);
-  files.value.find(v => v.name == opt.file.name).url = url;
-  fileUrls.value.push({
-    name: opt.file.name,
-    url
-  });
-  fileUploadDialogVisible.value = false;
-  ocrLayout();
-};
-
-const agencyFillList = ref([]);
-const getAgencyFillList = async () => {
-  const { data } = await request.get(
-    `/dataService/dataTemplate/mechanism/institution/paginate`,
-    {
-      params: {
-        page: 1,
-        pageSize: 1000
-      }
-    }
-  );
-  agencyFillList.value = data.list;
-};
-getAgencyFillList();
-const templateList = ref([]);
-const agencyChange = async () => {
-  const { data } = await request.get(
-    `/dataService/dataTemplate/mechanism/paginate`,
-    {
-      params: {
-        page: 1,
-        pageSize: 1000,
-        institutionId: institutionId.value
-      }
-    }
-  );
-  templateId.value = []
-  templateList.value = data.list;
-};
-
-const formatChildProjectChildren = (rowExtra, args) => {
-  let extra = {
-    ...rowExtra,
-    curChildIndex: [],
-    ...args
-  };
-  const children = [];
-  if (extra.abnormal && extra.abnormal.length) {
-    extra.abnormal.forEach(v => {
-      try {
-        v.properties.props = v.properties.props
-          ? typeof v.properties.props == "string"
-            ? JSON.parse(v.properties.props)
-            : v.properties.props
-          : "";
-      } catch (e) {
-        console.log(e, v.properties.props);
-      }
-      if (!v.nodeId && extra?.node?.id) {
-        v.nodeId = extra.node.id;
-      }
-      if (Array.isArray(v.properties.props)) {
-        v.properties.props.forEach(attr => {
-          delete attr.values;
-          delete attr.types;
-          attr.val = "";
-        });
-      }
-    });
-  }
-  return extra;
-};
-provide("formatChildProjectChildren", formatChildProjectChildren);
-
-const recognitionType = ["身体物质/部位", "医学检查项目"];
-const relatedRelationship = ["异常属于", "可检测"];
-const catchRelateNodes = {};
-const searchRelateNodes = async (id, relationship, query = {}) => {
-  if (catchRelateNodes[id + relatedRelationship[relationship]])
-    return catchRelateNodes[id + relatedRelationship[relationship]];
-  const { data } = await request.get(`/graphService/open/node/related`, {
-    params: { id, relationship: relatedRelationship[relationship], ...query }
-  });
-  catchRelateNodes[id + relatedRelationship[relationship]] = data || [];
-  return data || [];
-};
-provide("searchRelateNodes", searchRelateNodes);
-const searchAddNodes = async (key = "", isAddSearch = true, opt) => {
-  if (!key) return;
-  const { data } = await request.get(`/graphService/open/node/paginate`, {
-    params: {
-      pageSize: 500,
-      name: key,
-      tag: recognitionType[!isAddSearch && opt ? opt.type : 0],
-      ...(!isAddSearch && opt ? opt.params || {} : {})
-    }
-  });
-  if (isAddSearch) {
-    addIndicatorQuery.value = "";
-    allIndicators.value = data.list;
-  }
-  return data.list || [];
-};
-provide("searchAddNodes", searchAddNodes);
-
-const getDefaultItem = (opt = {}) => {
-  return {
-    annotation: {
-      id: ""
-    },
-    id: randomString(),
-    label: "indicator",
-    isPreviewModel: false,
-    node: [],
-    nodes: [],
-    matchProject: [],
-    indicators: [],
-    pageName: "page-0",
-    pageNum: 0,
-    header: ["key", "value", "unit", "scope"],
-    rows: [],
-    children: [],
-    ...opt
-  };
-};
-const formatItems = async arr => {
-  let item = getDefaultItem();
-  item.rows = arr.map(v => {
-    return [
-      {
-        infer: v.name,
-        extra: null
-      },
-      {
-        infer: v.value,
-        extra: null
-      },
-      {
-        infer: v.unit,
-        extra: null
-      },
-      {
-        infer: v.scope,
-        extra: null
-      }
-    ];
-  });
-  return item;
-};
-const formatTemplateItem = async v => {
-  const appendChildren = [];
-  let item = getDefaultItem({
-    templateId: v.id,
-    templateName: v.templateName,
-    date: ""
-  });
-  for (const k2 in v.templateItems) {
-    const v2 = v.templateItems[k2];
-    item.nodes[k2] = [v2.body];
-    item.node[k2] = v2.body?.id;
-    item.indicators[k2] = [v2.item];
-    item.matchProject[k2] = v2.item?.id;
-    const abnormal =
-      (await searchRelateNodes(v2.body.id, 0, { filter: 1 })) || [];
-    let valueLimit;
-    if (v2.body && v2.body.properties?.props) {
-      v2.body.properties.props = parseJSON(v2.body.properties?.props, "");
-      if (
-        Array.isArray(v2.body.properties.props) &&
-        v2.body.properties.props[0]
-      ) {
-        valueLimit = v2.body.properties.props[0];
-      }
-    }
-    item.rows.push([
-      {
-        infer: v2.name,
-        extra: {
-          abnormal: [abnormal],
-          node: v2.body,
-          projects: [v2.item],
-          valueLimit
-        }
-      },
-      {
-        infer: v2.defaultValue,
-        extra: null
-      },
-      {
-        infer: v2.unit,
-        extra: null
-      },
-      {
-        infer: v2.scope,
-        extra: null
-      }
-    ]);
-
-    abnormal.length &&
-      appendChildren.push({
-        id: v2.body.id,
-        abnormal,
-        rowIdx: k2
-      });
-  }
-  const temps = [];
-  appendChildren.forEach(child => {
-    const temp = formatChildProjectChildren(child, { rowIdx: child.rowIdx });
-    temps.push(temp);
-  });
-  item.children = temps;
-  return item;
-};
-
-let addTemplateLock = false;
-const addTemplate = async () => {
-  if (addTemplateLock) return;
-  addTemplateLock = true;
-  try {
-    for (const v of templateId.value) {
-      const template = templateList.value.find(v2 => v2.id == v);
-      template.templateItems = parseJSON(template.templateItems);
-      const item = await formatTemplateItem(template);
-      console.log(item);
-      list.value.push(item);
-      templateId.value = [];
-    }
-  } catch (e) {
-    ElMessage.error(e.message);
-  }
-  addTemplateLock = false;
-};
-const formatData = async () => {
-  console.log(list.value);
-  const result = [];
-
-  list.value.forEach(item => {
-    const bodyData = [];
-    const abnormalData = [];
-    if (item.children?.length) {
-      item.children.forEach(child => {
-        child.curChildIndex.forEach(k => {
-          const childProject = child.abnormal[k];
-          const abnormalItem = {
-            id: childProject.id,
-            name: childProject.properties?.name,
-            value: null
-          };
-          if (childProject.properties.props) {
-            const prop = {};
-            childProject.properties.props.forEach(attr => {
-              prop[attr.name] = String(attr.val);
-            });
-            abnormalItem.value = prop;
-          }
-          abnormalData.push(abnormalItem);
-        });
-      });
-    }
-    item.rows.map((row, rowIdx) => {
-      const extra = row[0].extra;
-      let bodyItem = {
-        name: "",
-        id: "",
-        value: "",
-        unit: "",
-        reference: "",
-        referStart: "",
-        referEnd: "",
-        itemId: item.matchProject[rowIdx],
-        itemName: item.matchProject[rowIdx]
-          ? item.indicators[rowIdx].find(v => v.id == item.matchProject[rowIdx])
-              ?.properties?.name
-          : "",
-        abnormalId: [],
-        abnormalDatas: []
-      };
-      bodyItem["originalName"] = row[0]?.infer || "";
-      item.header.forEach((key, idx) => {
-        if (item.label == "indicator") {
-          key = key == "key" ? "name" : key;
-          key = key == "scope" ? "reference" : key;
-          if (key === "reference" && row[idx]?.extra) {
-            bodyItem["reference"] = row[idx]?.extra.origin;
-            bodyItem["referStart"] = row[idx]?.extra.start;
-            bodyItem["referEnd"] = row[idx]?.extra.end;
-          } else {
-            bodyItem[key] = row[idx]?.infer || "";
-          }
-        }
-      });
-      if (item.label == "text") {
-        bodyItem["value"] = row[0]?.infer || "";
-      }
-      const findChildren = item.children.find(v => v.rowIdx == rowIdx);
-      if (findChildren) {
-        console.log("findChildren", findChildren, bodyItem);
-        bodyItem.abnormalId = findChildren.curChildIndex.map(i => {
-          const abnormalItem = {
-            id: findChildren.abnormal[i].id,
-            name: findChildren.abnormal[i]?.properties?.name,
-            nodeId: findChildren.abnormal[i].nodeId,
-            value: null
-          };
-          if (findChildren.abnormal[i].properties.props) {
-            const prop = {};
-            findChildren.abnormal[i].properties.props.forEach(attr => {
-              prop[attr.name] = String(attr.val);
-            });
-            abnormalItem.value = prop;
-          }
-          bodyItem.abnormalDatas.push(abnormalItem);
-          return {
-            id: abnormalItem.id,
-            nodeId: abnormalItem.nodeId,
-            name: abnormalItem.name
-          };
-        });
-      }
-      if (extra) {
-        console.log(extra);
-        bodyItem.id = extra.node.id;
-        bodyItem.name = extra.node.properties?.name;
-
-        bodyData.push(bodyItem);
-      } else {
-        if (item.label == "indicator" && item.node[rowIdx]) {
-          const curNode = item.nodes[rowIdx].find(
-            v => v.id == item.node[rowIdx]
-          );
-          bodyData.push({
-            ...bodyItem,
-            id: item.node[rowIdx],
-            name: curNode?.properties?.name
-          });
-        }
-        if (item.label == "text") {
-          if (item.node[rowIdx]?.length) {
-            for (const nodeId of item.node[rowIdx]) {
-              const curNode = item.nodes[rowIdx].find(v => v.id == nodeId);
-              console.log("curNode", curNode, bodyItem);
-              bodyData.push({
-                ...bodyItem,
-                id: nodeId,
-                name: curNode?.properties?.name
-              });
-            }
-          }
-        }
-      }
-    });
-    bodyData.forEach(v => {
-      v.abnormalId = v.abnormalId.filter(v2 => v2.nodeId == v.id);
-      v.abnormalDatas = v.abnormalDatas.filter(v2 => v2.nodeId == v.id);
-    });
-    console.log(bodyData);
-    console.log(abnormalData);
-    result.push({
-      bodyData,
-      abnormalData,
-      surveyData: "",
-      groupId: item.templateId,
-      groupName: item.templateName,
-      date: dayjs(item.date).unix()
-    });
-  });
-  return new Promise((resolve, reject) => {
-    resolve(result);
-  });
-};
-
-const ocrDataErrVisible = ref(false);
-const ocrDataErrList = ref([]);
-
-const checkData = async ocrData => {
-  const { data } = await request.post(`/idcService/mechanism/medicalData/algor/preCheck`, {
-    data: ocrData
-  });
-  ocrDataErrList.value = data.result?.errList || [];
-  ocrDataErrVisible.value = !!ocrDataErrList.value.length;
-  return data.result?.isCheckPass;
-};
-let saveLock = false;
-const save = async () => {
-  if (!archivesId.value) {
-    return ElMessage.error("请选择关联档案");
-  }
-  for (const item of list.value) {
-    if (!item.date) {
-      return ElMessage.error("请选择日期");
-    }
-  }
-  if (saveLock) return;
-  saveLock = true;
-  try {
-    await ElMessageBox.confirm(
-      "确定要提交数据?请核对数据发生日期与报告日期是否一致",
-      "提示"
-    );
-    const req = await formatData();
-    console.log("sendData===>", req);
-
-    const isCheckPass = await checkData(req);
-    if (!isCheckPass) {
-      ElMessage.error("存在错误信息");
-      saveLock = false;
-      return false;
-    }
-    // return false
-    if (route.query.sn) {
-      await request.post(
-        `/idcService/mechanism/medicalData/update/transferResult`,
-        {
-          sn: route.query.sn,
-          attachData: JSON.stringify(list.value),
-          data: req
-        }
-      );
-    } else {
-      await request.post(`/medicalData/create`, {
-        type: 4,
-        archivesId: archivesId.value,
-        date: dayjs(Date.now()).format("YYYY-MM-DD HH:mm:ss"),
-        attachData: JSON.stringify(list.value),
-        transferRawJson: JSON.stringify(req),
-        files: files.value.map(v => {
-          return {
-            fileName: v.name,
-            fileUrl: v.url,
-            remark: "",
-            date: dayjs(req[0].date * 1000).format("YYYY-MM-DD")
-          };
-        })
-      });
-    }
-
-    ElMessage.success("保存成功");
-    await sleep(3e2);
-    router.back();
-  } catch (e) {
-    console.log(e);
-  }
-  saveLock = false;
-};
-
-const getDetail = async () => {
-  const { data } = await request.get(`/medicalData/detail`, {
-    params: {
-      sn: route.query.sn
-    }
-  });
-
-  archivesId.value = data.detail.archivesId;
-  list.value = parseJSON(data.detail.attachData);
-  fileUrls.value = (data.detail.files || []).map(v => {
-    return {
-      ...v,
-      name: v.fileName,
-      url: v.fileUrl
-    };
-  });
-  fileUrls.value.length && ocrLayout();
-};
-
-const init = async () => {
-  if (route.query.sn) {
-    getDetail();
-  }
-};
-init();
-</script>
-<style lang="scss">
-.el-scrollbar__view {
-  height: 100%;
-  .main-content.page-upload-check-data {
-    margin: 0;
-  }
-}
-.page-upload-check-data {
-  .data-container {
-    height: calc(100% - 48px);
-    width: 100%;
-  }
-}
-</style>

+ 0 - 550
src/views/dataCenter/uploadData.vue

@@ -1,550 +0,0 @@
-<template>
-  <div>
-    <div class="flex items-center flex-wrap">
-      <div class="mr-4">
-        <Auth value="data:upload">
-          <el-button
-            type="primary"
-            class="mr-4"
-            @click="uploadDialogVisible = true"
-            >上传数据</el-button
-          >
-        </Auth>
-        <!-- <span>自动生成分析报告</span>
-        <el-switch></el-switch> -->
-      </div>
-      <div
-        class="flex flex-wrap flex-1 items-center justify-end space-x-2 space-y-2"
-      >
-        <div class="mt-2">
-          <el-checkbox
-            v-model="filter.isAbandon"
-            :true-label="2"
-            :false-label="0"
-            >隐藏作废数据</el-checkbox
-          >
-        </div>
-        <div>
-          <el-date-picker
-            v-model="filterDate"
-            type="daterange"
-            class="w-40"
-            format="YYYY/MM/DD"
-            value-format="YYYY-MM-DD"
-            :shortcuts="shortcuts"
-            placeholder="请选择"
-            :disabled-date="disabledDate"
-            @change="dateClear"
-          />
-        </div>
-
-        <el-select v-model.number="filter.type">
-          <el-option label="全部数据类型" :value="0"></el-option>
-          <template v-for="(item, index) in uploadDataPermissionType">
-            <el-option
-              v-if="!item?.permission || permissions.includes(item.permission)"
-              :key="index"
-              :label="item.label"
-              :value="Number(index)"
-            ></el-option>
-          </template>
-        </el-select>
-        <el-select v-model.string="filter.statusList">
-          <el-option label="全部处理状态" value="0"></el-option>
-          <el-option
-            v-for="(item, index) in uploadDataStatusList"
-            :key="index"
-            :label="item.label"
-            :value="item.value"
-          ></el-option>
-        </el-select>
-        <el-select
-          v-model="filterSnType"
-          @change="
-            filter.sn = '';
-            filter.archivesId = '';
-          "
-        >
-          <el-option label="数据批次号" value="sn"></el-option>
-          <el-option label="档案编号" value="archivesId"></el-option>
-        </el-select>
-        <el-input
-          v-model="filter[filterSnType]"
-          class="w-40"
-          placeholder="请输入查询内容"
-        ></el-input>
-        <el-button
-          type="primary"
-          @click="
-            filter.page = 1;
-            getList();
-          "
-          >搜索</el-button
-        >
-      </div>
-    </div>
-    <div>
-      <el-table :data="list" class="w-full mt-4">
-        <el-table-column prop="sn" label="数据批次号"></el-table-column>
-        <el-table-column
-          prop="files.length"
-          label="数据份数"
-          width="80"
-        ></el-table-column>
-        <el-table-column label="文件名称">
-          <template #default="{ row }">
-            <div v-if="row.fileName">{{ row.fileName }}</div>
-            <template v-else>
-              <!-- <div v-for="(item, index) in row.files || []" :key="index">
-                {{ item.fileName }}
-              </div> -->
-
-              {{ row.files[0] ? row.files[0].fileName : "未上传原始文件" }}
-              {{ row.files.length > 1 ? "等" : "" }}
-            </template>
-          </template>
-        </el-table-column>
-        <el-table-column
-          label="数据类型"
-          :formatter="v => uploadDataType[v.type]"
-        ></el-table-column>
-        <el-table-column prop="createdAt" label="上传时间"></el-table-column>
-        <el-table-column label="处理状态" width="120">
-          <template #default="{ row }">
-            <span :class="uploadDataStatus[row.status]?.showClass">{{
-              uploadDataStatus[row.status]?.showLabel
-            }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column
-          prop="archivesId"
-          label="关联的档案号"
-        ></el-table-column>
-        <el-table-column label="操作" width="300">
-          <template #default="{ row }">
-            <Auth value="data:view">
-              <template v-if="[6].includes(row.type)">
-                <Auth value="data:upload:visitRecord">
-                  <el-button
-                    type="primary"
-                    link
-                    @click="
-                      router.push({
-                        path: `/data/checkData`,
-                        query: {
-                          sn: row.sn
-                        }
-                      })
-                    "
-                    >查看数据</el-button
-                  >
-                </Auth>
-              </template>
-              <el-button
-                v-else
-                type="primary"
-                link
-                @click="
-                  router.push({
-                    path: `/data/checkData`,
-                    query: {
-                      sn: row.sn
-                    }
-                  })
-                "
-                >查看数据</el-button
-              >
-            </Auth>
-            <Auth value="data:edit">
-              <el-button type="primary" link @click="updateArchives(row)"
-                >修改关联档案</el-button
-              >
-            </Auth>
-            <!-- <Auth value="data:view">
-              <el-button
-                type="primary"
-                link
-                @click="showDownloadReportDialog(row)"
-                >分析报告</el-button
-              >
-            </Auth> -->
-            <el-button
-              :type="row.isAbandon != 1 ? 'danger' : 'warning'"
-              link
-              @click="abandonData(row)"
-              >{{ row.isAbandon == 1 ? "取消作废" : "作废数据" }}</el-button
-            >
-          </template>
-        </el-table-column>
-      </el-table>
-
-      <el-pagination
-        class="justify-end mt-4"
-        :current-page="filter.page"
-        :page-size="filter.pageSize"
-        :total="count"
-        background
-        layout="total, prev, pager, next, jumper"
-        @current-change="
-          page => {
-            filter.page = page;
-            getList();
-          }
-        "
-      ></el-pagination>
-    </div>
-    <UploadDataDialog v-model:visible="uploadDialogVisible" />
-    <el-dialog v-model="updateArchivesVisible" title="修改关联档案">
-      <el-form>
-        <el-form-item label="数据批次号">
-          <span>{{ updateArchivesRow.sn }}</span>
-        </el-form-item>
-        <el-form-item label="关联的档案">
-          <div>
-            <SearchArchivesSelect
-              v-model="updateArchivesRow.archivesId"
-              @change="archivesSelectChange"
-            />
-            <div class="mt-2">
-              <el-alert
-                v-if="!archivesBalanceFlag"
-                title="该用户余额不足,无法关联"
-                type="warning"
-                show-icon
-                :closable="false"
-              />
-            </div>
-          </div>
-        </el-form-item>
-      </el-form>
-      <template #footer>
-        <el-button
-          type="primary"
-          :disabled="!archivesBalanceFlag"
-          @click="saveUpdateArchive"
-          >保存</el-button
-        >
-      </template>
-    </el-dialog>
-
-    <el-dialog v-model="downloadReportDialog.visible" title="下载分析报告">
-      <div
-        v-for="(item, index) in downloadReportDialog.pdfResultList"
-        :key="index"
-        class="flex flex-col py-6 border-b border-solid border-gray-100 last:border-b-0"
-      >
-        <div class="flex items-center justify-between mb-2">
-          <div class="flex items-center">
-            <el-tag v-if="item?.pdfTemplate.isMember" size="small" class="mr-2"
-              >用户使用</el-tag
-            >
-            <span>{{ item?.pdfTemplate?.template?.name }}</span>
-          </div>
-          <span class="text-xs text-gray-500"
-            >最近生成时间: {{ item?.pdfTransferEndTime || "暂无" }}</span
-          >
-        </div>
-        <div class="flex items-center justify-between">
-          <div class="flex items-center">
-            <img src="@/assets/pdf.png" />
-            <span
-              >{{
-                downloadReportDialog.row?.files[0]?.fileName
-                  .split(".")
-                  .slice(0, -1)
-                  .join("")
-              }}.pdf</span
-            >
-          </div>
-          <div>
-            <el-button
-              type="primary"
-              plain
-              tag="a"
-              target="_blank"
-              :href="item?.pdfTransferResultUrl"
-              >在线预览</el-button
-            >
-            <el-button
-              type="primary"
-              @click="
-                downloadReportRename(
-                  item?.pdfTransferResultUrl +
-                    '?response-content-type=application/octet-stream',
-                  `${downloadReportDialog.row?.files[0]?.fileName
-                    .split('.')
-                    .slice(0, -1)
-                    .join('')}.pdf`
-                )
-              "
-              >下载报告</el-button
-            >
-          </div>
-        </div>
-      </div>
-      <el-empty v-if="!downloadReportDialog.pdfResultList.length"></el-empty>
-      <!-- <div>
-        <span>报告最近生成时间:{{ downloadReportDialog.row.pdfTransferEndTime || '暂无' }}</span>
-        <el-button type="primary" class="ml-4" @click="generatePdf">生成/更新报告</el-button>
-      </div>
-      <div class="flex justify-center items-center flex-col pt-12">
-        <div v-if="downloadReportDialog.row.pdfTransferStatus == 2" class="flex items-center">
-          <img src="@/assets/pdf.png" />
-          <span class="text-gray-500">正在生成中...</span>
-          <el-button type="primary" class="ml-4" @click="refreshDetail">刷新</el-button>
-        </div>
-        <div v-if="downloadReportDialog.row.pdfTransferStatus == 3" class="flex items-center">
-          <img src="@/assets/pdf.png" />
-          <span>{{ downloadReportDialog.row.sn }}{{ downloadReportDialog.row.archivesId }}.pdf</span>
-        </div>
-        <div v-if="downloadReportDialog.row.pdfTransferResultUrl" class="flex justify-around items-center space-x-4 mt-12">
-          <el-button type="primary" plain  tag="a" target="_blank" :href="downloadReportDialog.row.pdfTransferResultUrl">在线预览</el-button>
-          <el-button type="primary" tag="a" target="_blank" :href="downloadReportDialog.row.pdfTransferResultUrl + '?response-content-type=application/octet-stream'" :download="`${downloadReportDialog.row.sn}${downloadReportDialog.row.archivesId}.pdf`">下载报告</el-button>
-        </div>
-      </div> -->
-    </el-dialog>
-  </div>
-</template>
-
-<script setup>
-import { ref, reactive, onMounted, watch, provide, shallowRef } from "vue";
-import { useRoute, useRouter, onBeforeRouteLeave } from "vue-router";
-import UploadDataDialog from "./components/UploadDataDialog.vue";
-import SearchArchivesSelect from "@/components/Archives/SearchArchivesSelect.vue";
-import {
-  uploadDataType,
-  uploadDataPermissionType,
-  uploadDataStatus,
-  uploadDataStatusList,
-  uploadDataAbandon
-} from "@/enums/archives";
-import { request, downloadReportRename, disabledDate } from "@/utils";
-import { ElMessage, ElMessageBox } from "element-plus";
-import dayjs from "dayjs";
-
-const router = useRouter();
-const filter = ref({
-  page: 1,
-  pageSize: 10,
-  type: 0,
-  statusList: "0",
-  archivesId: "",
-  startTime: dayjs().subtract(180, "day").format("YYYY-MM-DD"),
-  endTime: dayjs().format("YYYY-MM-DD"),
-  isAbandon: 2,
-  sn: ""
-});
-const filterDate = ref([
-  dayjs().subtract(180, "day").format("YYYY-MM-DD"),
-  dayjs().format("YYYY-MM-DD")
-]);
-const dateClear = v => {
-  if (!v) {
-    filter.value.startTime = "";
-    filter.value.endTime = "";
-  }
-};
-const shortcuts = [
-  {
-    text: "最近一周",
-    value: () => {
-      const end = new Date();
-      const start = new Date();
-      start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
-      return [start, end];
-    }
-  },
-  {
-    text: "最近一个月",
-    value: () => {
-      const end = new Date();
-      const start = new Date();
-      start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
-      return [start, end];
-    }
-  },
-  {
-    text: "最近三个月",
-    value: () => {
-      const end = new Date();
-      const start = new Date();
-      start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
-      return [start, end];
-    }
-  },
-  {
-    text: "最近半年",
-    value: () => {
-      const end = new Date();
-      const start = new Date();
-      start.setTime(start.getTime() - 3600 * 1000 * 24 * 180);
-      return [start, end];
-    }
-  }
-];
-const filterSnType = ref("sn");
-
-watch(
-  () => filterDate.value,
-  d => {
-    console.log(d);
-    if (d) {
-      [filter.value.startTime, filter.value.endTime] = d;
-    }
-  }
-);
-
-const uploadDialogVisible = ref(false);
-
-const list = ref([]);
-const count = ref(0);
-const getList = async () => {
-  const { data } = await request.get(`/medicalData/paginate`, {
-    params: filter.value
-  });
-  list.value = data.list;
-  count.value = data.total;
-};
-provide("getList", getList);
-
-const downloadReportDialog = reactive({
-  visible: false,
-  row: {},
-  pdfResultList: [],
-  timer: null
-});
-
-const getPdfResultList = async row => {
-  const { data } = await request.get(
-    `/idcService/mechanism/medicalData/pdfResult/list`,
-    {
-      params: { sn: row.sn }
-    }
-  );
-  downloadReportDialog.pdfResultList = data.list || [];
-};
-const showDownloadReportDialog = row => {
-  downloadReportDialog.row = { ...row };
-  getPdfResultList(row);
-  downloadReportDialog.visible = true;
-};
-// const generatePdf = async () => {
-//   await request.post(`/medicalData/pdfReport/generate`, {
-//     sn: downloadReportDialog.row.sn
-//   })
-//   ElMessage.info('开始生成,请耐心等待...')
-//   downloadReportDialog.row.pdfTransferStatus = 2
-//   downloadReportDialog.row.pdfTransferResultUrl = ''
-//   downloadReportDialog.timer && clearTimeout(downloadReportDialog.timer)
-//   downloadReportDialog.timer = setTimeout(refreshDetail, 2e3)
-// }
-// const refreshDetail = async () => {
-//   const { data } = await request.get(`/medicalData/detail`, {
-//     params: {
-//       sn: downloadReportDialog.row.sn
-//     }
-//   })
-//   downloadReportDialog.row = data.detail
-//   if (!data.detail.pdfTransferResultUrl) {
-//     downloadReportDialog.timer && clearTimeout(downloadReportDialog.timer)
-//     downloadReportDialog.timer = setTimeout(refreshDetail, 2e3)
-//   }
-// }
-
-const checkBalance = async archiveId => {
-  const { data } = await request.get(
-    `/walletService/mechanism/membershipCard/archive`,
-    {
-      params: {
-        archiveId,
-        walletTypeId: 1
-      }
-    }
-  );
-  if (!data.uploadReport) return false
-  if (data.uploadReportTimes == -1) return true;
-  return data.uploadReportTimes - data.uploadReportUsed > 0;
-};
-const updateArchivesRowOriginId = ref();
-const updateArchivesRow = ref();
-const updateArchivesVisible = ref(false);
-const updateArchives = async row => {
-  console.log(row);
-  updateArchivesRowOriginId.value = row.archivesId;
-  updateArchivesRow.value = { ...row };
-  updateArchivesVisible.value = true;
-};
-const archivesBalanceFlag = ref(true);
-const archivesSelectChange = async (archivesId, archives) => {
-  console.log(archives);
-  archivesBalanceFlag.value = true;
-  if (
-    updateArchivesRowOriginId.value &&
-    archivesId == updateArchivesRowOriginId.value
-  ) {
-    return;
-  }
-  if (
-    archives.familyIds &&
-    archives.familyIds.includes(updateArchivesRowOriginId.value)
-  ) {
-    return;
-  }
-  archivesBalanceFlag.value = await checkBalance(
-    archives.mainArchivesId || archives.id
-  );
-};
-const saveUpdateArchive = async () => {
-  await request.post(`/medicalData/update/archives`, {
-    sn: updateArchivesRow.value.sn,
-    archivesId: updateArchivesRow.value.archivesId
-  });
-  ElMessage.success("操作成功");
-  getList();
-  updateArchivesVisible.value = false;
-};
-const permissions = shallowRef([]);
-const getPermissions = async () => {
-  const { data } = await request.get(`/mechanismService/mechanism/profile`);
-  permissions.value = data.profile?.permissions || [];
-};
-onBeforeRouteLeave(() => {
-  sessionStorage.setItem("dataManageFilter", JSON.stringify(filter.value));
-});
-onMounted(() => {
-  let sFilter = sessionStorage.getItem("dataManageFilter");
-  if (sFilter) {
-    filter.value = JSON.parse(sFilter);
-    sessionStorage.removeItem("dataManageFilter");
-  }
-
-  const teamReportDataSourceFilter = sessionStorage.getItem(
-    "tempReportDataSource"
-  );
-  if (teamReportDataSourceFilter) {
-    filter.value = {
-      ...filter.value,
-      ...JSON.parse(teamReportDataSourceFilter)
-    };
-    filterDate.value = [filter.value.startTime, filter.value.endTime];
-    sessionStorage.removeItem("tempReportDataSource");
-  }
-  getList();
-  getPermissions();
-});
-const abandonData = row => {
-  ElMessageBox.confirm(
-    `确认${row.isAbandon == 1 ? "取消" : ""}作废该条数据吗?`,
-    "提示"
-  ).then(async () => {
-    await request.post(
-      `/medicalData/abandon${row.isAbandon == 1 ? "/cancel" : ""}`,
-      { sn: row.sn }
-    );
-    ElMessage.success("删除成功");
-    getList();
-  });
-};
-</script>
-
-<style lang="scss" scoped></style>

+ 0 - 3
src/views/demand/apply.vue

@@ -1,3 +0,0 @@
-<template>
-  <div>这是服务商申请页面</div>
-</template>

+ 0 - 142
src/views/demand/category.vue

@@ -1,142 +0,0 @@
-<template>
-  <div>
-    <el-card shadow="never">
-      <div>
-        <el-button type="primary" @click="handleCreate">新建需求类别</el-button>
-        <!-- <el-button type="primary" @click="handleUpdateServiceProvider"
-          >服务商设置</el-button
-        > -->
-      </div>
-    </el-card>
-    <el-card shadow="never" class="mt-4">
-      <div>
-        <el-table :data="state.tableData" style="width: 100%">
-          <el-table-column prop="name" label="类别名称"> </el-table-column>
-          <el-table-column prop="name" label="是否启用">
-            <template #default="{ row }">
-              <el-switch
-                v-model="row.status"
-                :active-value="1"
-                :inactive-value="0"
-                @change="onChangeStatus(row)"
-              >
-              </el-switch>
-            </template>
-          </el-table-column>
-          <el-table-column prop="sort" label="排序(数字越大越排在前)">
-            <template #default="{ row }">
-              <el-input
-                v-model.number="row.sort"
-                type="number"
-                @blur="updateSort(row)"
-              ></el-input>
-            </template>
-          </el-table-column>
-          <el-table-column prop="" label="操作">
-            <template #default="{ row }">
-              <el-button type="primary" link @click="handleEdit(row)"
-                >编辑</el-button
-              >
-            </template>
-          </el-table-column>
-        </el-table>
-        <el-pagination
-          class="mt-4 justify-end"
-          background
-          layout="prev, pager, next"
-          :total="state.pagination.total"
-          @current-change="changePage"
-        />
-      </div>
-    </el-card>
-    <ComponentUpdateCategory
-      v-model:show="state.visible"
-      :rowData="state.rowData"
-      @success="getTableData"
-    ></ComponentUpdateCategory>
-    <ComponentDialogService
-      v-model:show="state.visibleServiceProvider"
-    ></ComponentDialogService>
-  </div>
-</template>
-<script lang="ts" setup>
-import { request } from "@/utils";
-import { ElMessage, ElMessageBox } from "element-plus";
-import { ref, reactive } from "vue";
-import ComponentUpdateCategory from "./components/UpdateCategory.vue";
-import ComponentDialogService from "./components/DialogService.vue";
-const state = reactive({
-  query: {
-    page: 1,
-    pageSize: 15
-  },
-  pagination: {
-    total: 0
-  },
-  tableData: [],
-  visible: false,
-  rowData: {},
-  visibleServiceProvider: false // 服务商设置
-});
-const init = () => {
-  getTableData();
-};
-
-const getTableData = () => {
-  request
-    .get("/articleService/demand/category/paginate", {
-      params: state.query
-    })
-    .then(resp => {
-      console.log("获取的需求", resp);
-      state.tableData = resp?.data.list;
-      state.pagination.total = resp.data.total;
-    });
-};
-
-const updateSort = async row => {
-  let resp = await request.post("/articleService/demand/category/sort", {
-    id: row.id,
-    sort: row.sort
-  });
-  ElMessage.success(resp.message);
-  getTableData();
-};
-
-const onChangeStatus = row => {
-  ElMessageBox.confirm(
-    row.status ? "确定要启用此类别吗?" : "确定要关闭此类别吗?",
-    "",
-    {
-      distinguishCancelAndClose: true,
-      confirmButtonText: "确定",
-      cancelButtonText: "取消"
-    }
-  )
-    .then(async () => {
-      await request.post("/articleService/demand/category/status", row);
-      ElMessage.success("操作成功");
-      getTableData();
-    })
-    .catch(err => {
-      row.status = row.status ? 0 : 1;
-    });
-};
-const handleCreate = () => {
-  state.visible = true;
-  state.rowData = {};
-  console.log("state.rowData", state.rowData);
-};
-const handleUpdateServiceProvider = () => {
-  state.visibleServiceProvider = true;
-};
-const handleEdit = row => {
-  state.visible = true;
-  state.rowData = row;
-};
-const changePage = page => {
-  state.query.page = page;
-  getTableData();
-};
-init();
-</script>

+ 0 - 222
src/views/demand/components/DialogEditDemand.vue

@@ -1,222 +0,0 @@
-<template>
-  <div>
-    <el-dialog title="需求管理" v-model="dialogVisible">
-      <div>
-        <el-form ref="formRef" :model="state.form">
-          <el-form-item
-            label="选择档案人:"
-            :rules="[{ required: true, message: '请选择档案' }]"
-            prop="archiveSn"
-          >
-            <el-select
-              v-model="state.form.archiveSn"
-              placeholder="选择档案人"
-              filterable
-              remote
-              reserve-keyword
-              :remote-method="remoteMethod"
-              :loading="state.loading"
-              @change="handleChangeArchive"
-              @clear="getArchivesList"
-              clearable
-            >
-              <el-option
-                v-for="item in state.archivesList"
-                :label="item.label"
-                :value="item.id"
-                :key="item.id"
-              ></el-option>
-            </el-select>
-          </el-form-item>
-          <!-- <template v-if="state.currentArchive?.id">
-
-          </template> -->
-          <el-form-item label="提交人姓名:">
-            <el-text>{{ state.currentArchive?.name || "暂无数据" }}</el-text>
-          </el-form-item>
-          <el-form-item label="提交人性别:">
-            <el-text v-if="!state.currentArchive?.gender">暂无数据</el-text>
-            <el-text v-else>{{
-              state.currentArchive?.gender == 1 ? "男" : "女"
-            }}</el-text>
-          </el-form-item>
-          <el-form-item label="提交人年龄:">
-            <el-text v-if="!state.currentArchive?.gender">暂无数据</el-text>
-            <el-text v-else>{{
-              formatAgeMethod(state.currentArchive?.birthday)
-            }}</el-text>
-          </el-form-item>
-          <el-form-item label="提交人手机号:">
-            <el-input
-              v-model="state.form.mobile"
-              placeholder="请输入手机号"
-              clearable
-            ></el-input>
-          </el-form-item>
-          <el-form-item label="提交人住址:">
-            <el-text v-if="state.currentArchive?.community">
-              {{
-                state.currentArchive?.provinceText +
-                state.currentArchive?.cityText +
-                state.currentArchive?.areaText +
-                state.currentArchive?.subDistrict +
-                state.currentArchive?.community +
-                state.currentArchive?.village +
-                state.currentArchive?.building +
-                state.currentArchive?.houseNumber
-              }}
-            </el-text>
-            <el-text v-else></el-text>
-          </el-form-item>
-          <el-divider></el-divider>
-          <el-form-item
-            label="需求类别:"
-            :rules="[{ required: true, message: '请选择需求类别' }]"
-            prop="categoryId"
-          >
-            <el-select
-              v-model="state.form.categoryId"
-              placeholder="请选择需求类别"
-            >
-              <el-option
-                v-for="item in state.categoryList"
-                :label="item.name"
-                :value="item.id"
-                :key="item.id"
-              ></el-option>
-            </el-select>
-          </el-form-item>
-          <el-form-item
-            label="需求内容:"
-            :rules="[{ required: true, message: '请输入需求内容' }]"
-            prop="content"
-          >
-            <el-input
-              v-model="state.form.content"
-              placeholder="请输入需求内容"
-              show-word-limit
-              type="textarea"
-              rows="5"
-            />
-          </el-form-item>
-        </el-form>
-      </div>
-      <template #footer>
-        <div>
-          <el-button @click="dialogVisible = false">取 消</el-button>
-          <el-button type="primary" @click="handleSubmit">确 定</el-button>
-        </div>
-      </template>
-    </el-dialog>
-  </div>
-</template>
-<script lang="ts" setup>
-import { request, formatAge } from "@/utils";
-import { ElMessage } from "element-plus";
-import { ref, computed, defineProps, defineEmits, watch, reactive } from "vue";
-const props = defineProps({
-  show: {
-    type: Boolean,
-    default: false
-  }
-});
-const emits = defineEmits(["update:show", "success"]);
-const formRef = ref();
-const formatAgeMethod = formatAge;
-const state = reactive({
-  form: {
-    archiveSn: "",
-    categoryId: "", // 需求类别,
-    mobile: "", // 手机
-    content: "" // 需求内容
-  },
-  loading: false,
-  archivesList: [],
-  currentArchive: {},
-  categoryList: []
-});
-const dialogVisible = computed({
-  get() {
-    return props.show;
-  },
-  set(n) {
-    emits("update:show", n);
-  }
-});
-
-watch(
-  () => dialogVisible.value,
-  n => {
-    if (n) {
-      initData();
-    } else {
-      onReset();
-    }
-  }
-);
-const getArchivesList = (query: string) => {
-  state.loading = true;
-  request
-    .get("archivesService/mechanism/archives/paginate", {
-      params: {
-        page: 1,
-        pageSize: 15,
-        keyword: query
-      }
-    })
-    .then(resp => {
-      let list = resp.data.list;
-      state.archivesList = list.map(v => {
-        return {
-          ...v,
-          label: `${v.name}(${v.id})`
-        };
-      });
-    })
-    .finally(() => {
-      state.loading = false;
-    });
-};
-const remoteMethod = (query: string) => {
-  if (query) {
-    getArchivesList(query);
-  }
-};
-const handleChangeArchive = params => {
-  state.currentArchive = state.archivesList.find(v => v.id == params);
-};
-const getCategory = () => {
-  request
-    .get("articleService/demand/category/paginate", {
-      params: {
-        pageSize: 1000
-      }
-    })
-    .then(resp => {
-      let list = resp.data.list;
-      // 政策类别不包含
-      state.categoryList = list.filter(v => {
-        return v.id != 1;
-      });
-    });
-};
-
-const onReset = () => {
-  formRef.value.resetFields();
-  state.currentArchive = {};
-};
-const handleSubmit = () => {
-  formRef.value.validate((valid, fields) => {
-    if (!valid) return;
-    request.post("articleService/demand", state.form).then(resp => {
-      ElMessage.success(resp.message);
-      dialogVisible.value = false;
-      emits("success");
-    });
-  });
-};
-const initData = () => {
-  getCategory();
-  getArchivesList();
-};
-</script>

+ 0 - 223
src/views/demand/components/DialogHandle.vue

@@ -1,223 +0,0 @@
-<template>
-  <div>
-    <el-dialog title="处理需求" v-model="dialogVisible">
-      <div>
-        <el-descriptions :column="3">
-          <el-descriptions-item label="提交人档案号:">{{
-            state.info?.archiveSn
-          }}</el-descriptions-item>
-          <el-descriptions-item label="提交人姓名:">{{
-            state.info?.archive?.name || "-"
-          }}</el-descriptions-item>
-          <el-descriptions-item label="提交人性别:">
-            <el-tag
-              type=""
-              v-if="state.info?.archive?.gender == 1"
-              effect="plain"
-              >男</el-tag
-            >
-            <el-tag type="danger" v-else effect="plain">女</el-tag>
-          </el-descriptions-item>
-          <el-descriptions-item label="提交人年龄:">{{
-            formatAge(state.info.archive?.birthday)
-          }}</el-descriptions-item>
-          <el-descriptions-item label="提交人手机号:">{{
-            state.info.mobile || "-"
-          }}</el-descriptions-item>
-          <el-descriptions-item label="提交人住址:">
-            <el-text v-if="state.info?.archive?.community">
-              {{
-                state.info?.archive?.province +
-                state.info?.archive?.city +
-                state.info?.archive?.area +
-                state.info?.archive?.subDistrict +
-                state.info?.archive?.community +
-                state.info?.archive?.village +
-                state.info?.archive?.building +
-                state.info?.archive?.houseNumber
-              }}
-            </el-text>
-            <el-text v-else>-</el-text>
-          </el-descriptions-item>
-        </el-descriptions>
-        <el-divider></el-divider>
-        <el-descriptions :column="1">
-          <el-descriptions-item label="需求类别:">
-            {{ state.info?.category?.name }}
-          </el-descriptions-item>
-          <el-descriptions-item label="需求内容:">
-            {{ state.info.content }}
-          </el-descriptions-item>
-        </el-descriptions>
-        <el-divider></el-divider>
-        <el-form ref="form" label-width="110px" label-position="left">
-          <el-form-item
-            label="服务商:"
-            :required="[1, 2].includes(state.status)"
-          >
-            <el-select
-              v-model="state.processorId"
-              filterable
-              clearable
-              placeholder="请选择服务商"
-            >
-              <el-option
-                v-for="item in state.processors"
-                :key="item.sn"
-                :label="item.nickname"
-                :value="item.sn"
-              >
-                <el-text>{{ item.nickname }}</el-text>
-                <el-tag class="ml-2">{{ item.sn }}</el-tag>
-              </el-option>
-            </el-select>
-          </el-form-item>
-
-          <el-form-item label="需求状态:" required>
-            <el-select v-model="state.status" placeholder="需求状态">
-              <el-option
-                v-for="item in state.statusList"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value"
-              >
-              </el-option>
-            </el-select>
-          </el-form-item>
-          <el-form-item label="需求处理备注:">
-            <el-input
-              v-model="state.comment"
-              placeholder="请输入需求内容"
-              show-word-limit
-              type="textarea"
-              rows="5"
-            />
-          </el-form-item>
-          <el-form-item label="">
-            <UploadOnlyImage
-              v-model:url="state.images"
-              :key="coverKey"
-              type="image"
-            />
-          </el-form-item>
-        </el-form>
-      </div>
-      <template #footer>
-        <div>
-          <el-button @click="dialogVisible = false">取 消</el-button>
-          <el-button
-            type="primary"
-            @click="handleSubmit"
-            :loading="state.loading"
-            >确 定</el-button
-          >
-        </div>
-      </template>
-    </el-dialog>
-  </div>
-</template>
-<script lang="ts" setup>
-import { request, formatAge } from "@/utils";
-import { ElMessage } from "element-plus";
-import { ref, computed, defineProps, defineEmits, watch, reactive } from "vue";
-import UploadOnlyImage from "@/components/UploadOnlyImage.vue";
-
-const props = defineProps({
-  show: {
-    type: Boolean,
-    default: false
-  },
-  rowData: {
-    type: Object,
-    default: () => {}
-  }
-});
-const emits = defineEmits(["update:show", "success"]);
-const state = reactive({
-  status: 0,
-  comment: "",
-  info: {},
-  processors: [],
-  processorId: [],
-  loading: false,
-  images: [],
-  statusList: [
-    {
-      value: 0,
-      label: "待处理"
-    },
-    {
-      value: 1,
-      label: "处理中"
-    },
-    {
-      value: 2,
-      label: "已处理"
-    }
-  ]
-});
-const dialogVisible = computed({
-  get() {
-    return props.show;
-  },
-  set(n) {
-    emits("update:show", n);
-  }
-});
-
-watch(
-  () => dialogVisible.value,
-  n => {
-    if (n) {
-      state.info = props.rowData;
-      state.status = props.rowData.status;
-      state.comment = props.rowData.comment;
-      state.processorId = props.rowData.processorId;
-      state.images = props.rowData.images?.map((v, i) => {
-        return {
-          url: v,
-          name: "images" + i,
-          status: "success",
-          uid: new Date().getTime()
-        };
-      });
-      getProcessors();
-    } else {
-      onReset();
-    }
-  }
-);
-
-const getProcessors = () => {
-  request.get("/articleService/demand/processors").then(resp => {
-    state.processors = resp.data;
-  });
-};
-
-const handleSubmit = () => {
-  if ([1, 2].includes(state.status) && !state.processorId) {
-    return ElMessage.error("请选择服务商");
-  }
-  state.loading = true;
-  request
-    .post("articleService/demand/update", {
-      id: state?.info.id,
-      status: 2,
-      comment: state.comment,
-      processorId: state.processorId,
-      images: state.images.map(v => v.url)
-    })
-    .then(resp => {
-      dialogVisible.value = false;
-      ElMessage.success(resp.message);
-      emits("success");
-    })
-    .finally(() => {
-      state.loading = false;
-    });
-};
-const onReset = () => {
-  state.info = {};
-  console.log("执行成功");
-};
-</script>

+ 0 - 99
src/views/demand/components/DialogService.vue

@@ -1,99 +0,0 @@
-<template>
-  <div>
-    <el-dialog title="服务商设置" v-model="dialogVisible">
-      <div>
-        <el-form>
-          <el-form-item label="设置服务商" required>
-            <el-select
-              v-model="state.roleIds"
-              filterable
-              placeholder="选择角色"
-              clearable
-            >
-              <el-option
-                :label="item.name"
-                :value="item.id"
-                v-for="item in state.roleList"
-                :key="item.id"
-              ></el-option>
-            </el-select>
-          </el-form-item>
-        </el-form>
-      </div>
-      <template #footer>
-        <div>
-          <el-button @click="dialogVisible = false">取 消</el-button>
-          <el-button type="primary" @click="handleSubmit">确 定</el-button>
-        </div>
-      </template>
-    </el-dialog>
-  </div>
-</template>
-<script lang="ts" setup>
-import { ref, computed, defineProps, defineEmits, watch, reactive } from "vue";
-import { request } from "@/utils";
-import { ElMessage } from "element-plus";
-
-const state = reactive({
-  roleList: [],
-  roleIds: undefined
-});
-const props = defineProps({
-  show: {
-    type: Boolean,
-    default: false
-  }
-});
-const emits = defineEmits(["update:show", "success"]);
-const dialogVisible = computed({
-  get() {
-    return props.show;
-  },
-  set(n) {
-    emits("update:show", n);
-  }
-});
-
-watch(
-  () => dialogVisible.value,
-  n => {
-    if (n) {
-      init();
-      getList();
-    } else {
-    }
-  }
-);
-
-const init = () => {
-  state.roleIds = undefined;
-};
-const getList = () => {
-  request
-    .get("/mechanism/role/list", {})
-    .then(resp => {
-      // getProcessors();
-      state.roleList = resp.data.list;
-    })
-    .finally(() => {});
-};
-const getProcessors = () => {
-  request.get("/articleService/demand/processors").then(resp => {
-    state.roleIds = resp.data.map(v => v.sn)?.[0];
-  });
-};
-const handleSubmit = () => {
-  if (!state.roleIds) {
-    return ElMessage.error("请选择服务商");
-  }
-  request
-    .post("/articleService/demand/role", {
-      roleIds: [state.roleIds]
-    })
-    .then(resp => {
-      ElMessage.success(resp.message);
-      dialogVisible.value = false;
-      emits("success");
-    });
-};
-</script>

+ 0 - 190
src/views/demand/components/UpdateCategory.vue

@@ -1,190 +0,0 @@
-<template>
-  <div>
-    <el-dialog title="类别管理" v-model="dialogVisible">
-      <div>
-        <el-form ref="formDataRef" :model="formData" label-width="120px">
-          <el-form-item
-            label="类别名称"
-            prop="name"
-            :rules="[{ required: true, message: '请输入类别名称' }]"
-          >
-            <el-input
-              v-model="formData.name"
-              placeholder="请输入类别名称"
-              clearable
-            ></el-input>
-          </el-form-item>
-          <el-form-item
-            label="封面"
-            required
-            prop="icon"
-            :rules="[{ validator: validateIcon, trigger: 'blur' }]"
-          >
-            <UploadOnlyImage
-              v-model:url="formData.icon"
-              :key="coverKey"
-              type="image"
-            />
-          </el-form-item>
-          <el-form-item
-            label="关联知识库板块"
-            prop="icon"
-            :rules="[{ required: true, message: '请选择板块' }]"
-            v-if="props.rowData?.id && props.rowData?.name == '政策'"
-          >
-            <el-select v-model="formData.moduleId" placeholder="请选择板块">
-              <el-option
-                :label="item.name"
-                :value="item.id"
-                v-for="item in articleList"
-                :key="item.sn"
-              ></el-option>
-            </el-select>
-          </el-form-item>
-        </el-form>
-      </div>
-      <template #footer>
-        <div>
-          <el-button @click="dialogVisible = false">取 消</el-button>
-          <el-button type="primary" @click="handleSubmit">确 定</el-button>
-        </div>
-      </template>
-    </el-dialog>
-  </div>
-</template>
-<script lang="ts" setup>
-import { ref, computed, defineProps, defineEmits, watch, reactive } from "vue";
-import UploadOnlyImage from "@/components/UploadOnlyImage.vue";
-import type { UploadProps } from "element-plus";
-import { Plus } from "@element-plus/icons-vue";
-import { request } from "@/utils";
-import { ElMessage } from "element-plus";
-import { nextTick } from "process";
-const props = defineProps({
-  show: {
-    type: Boolean,
-    default: false
-  },
-  rowData: {
-    type: Object,
-    default: () => {}
-  }
-});
-const formData = ref({
-  name: "",
-  icon: [],
-  moduleId: ""
-});
-const validateIcon = (rule: any, value: any, callback: any) => {
-  console.log(value);
-
-  if (!formData.value.icon.length) {
-    callback(new Error("请上传封面"));
-  } else {
-    callback();
-  }
-};
-const formDataRef = ref();
-const articleList = ref([]);
-const coverKey = ref(Date.now());
-
-const emits = defineEmits(["update:show", "success"]);
-const dialogVisible = computed({
-  get() {
-    return props.show;
-  },
-
-  set(n) {
-    emits("update:show", n);
-  }
-});
-
-watch(
-  () => dialogVisible.value,
-  n => {
-    if (n) {
-      initData();
-      if (props.rowData.id) {
-        console.log(props.rowData);
-        let { icon } = props.rowData;
-        formData.value = {
-          ...props.rowData,
-          icon: icon
-            ? [
-                {
-                  name: "food.jpeg",
-                  url: icon
-                }
-              ]
-            : []
-        };
-      }
-      console.log(formData.value);
-    } else {
-      nextTick(onReset);
-    }
-  }
-);
-const getArticleList = () => {
-  // articleService/module/paginate
-  request
-    .get("articleService/module/paginate", {
-      params: {
-        page: 1,
-        pageSize: 1000
-      }
-    })
-    .then(resp => {
-      articleList.value = resp.data.list;
-    });
-};
-
-const onReset = () => {
-  formDataRef.value.resetFields();
-  formData.value.icon = [];
-  formData.value.name = "";
-  formData.value.moduleId = "";
-
-  coverKey.value++;
-};
-const handleSubmit = () => {
-  formDataRef.value.validate((valid, fields) => {
-    if (!valid) return;
-    let params = {
-      id: formData.value?.id,
-      name: formData.value?.name,
-      moduleId: formData.value?.moduleId || undefined,
-      icon: formData.value?.icon[0].url
-    };
-    let api = props.rowData.id
-      ? "articleService/demand/category/update"
-      : "articleService/demand/category";
-    request.post(api, params).then(resp => {
-      ElMessage.success(resp.message);
-      dialogVisible.value = false;
-      emits("success");
-    });
-  });
-};
-// const beforeAvatarUpload: UploadProps["beforeUpload"] = rawFile => {
-//   if (!["image/png", "image/jpeg"].includes(rawFile.type)) {
-//     ElMessage.error("Avatar picture must be JPG format!");
-//     return false;
-//   } else if (rawFile.size / 1024 / 1024 > 2) {
-//     ElMessage.error("Avatar picture size can not exceed 2MB!");
-//     return false;
-//   }
-//   return true;
-// };
-
-// const simpleImgHttpUpload = options => {
-//   console.log("options", options);
-//   uploadToOSS(options.file, options.file.name).then(resp => {
-//     state.ruleForm.url = resp;
-//   });
-// };
-const initData = () => {
-  getArticleList();
-};
-</script>
-<style lang="scss" scoped></style>

+ 0 - 278
src/views/demand/index.vue

@@ -1,278 +0,0 @@
-<template>
-  <div>
-    <el-card shadow="never">
-      <el-row :gutter="10">
-        <el-col :span="6">
-          <el-button type="primary" @click="handleCreate">新建需求</el-button>
-        </el-col>
-        <el-col :span="18" class="text-right">
-          <div class="flex">
-            <el-select
-              v-model="state.query.status"
-              placeholder="处理情况"
-              class="mr-2"
-            >
-              <el-option label="全部处理情况" :value="undefined"></el-option>
-              <el-option
-                v-for="item in state.statusList"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value"
-              >
-              </el-option>
-            </el-select>
-            <el-input
-              v-model="state.query.search"
-              placeholder="输入搜索内容"
-              class="mr-2"
-            >
-              <template #prepend>
-                <el-select
-                  v-model="state.query.searchKey"
-                  placeholder="处理情况"
-                  class="mr-2"
-                >
-                  <el-option label="提交人姓名" value="name"></el-option>
-                  <el-option label="提交人档案号" value="archiveSn"></el-option>
-                  <el-option label="提交人手机号" value="mobile"></el-option>
-                </el-select>
-              </template>
-            </el-input>
-
-            <el-button type="primary" :icon="Search" @click="onSearch"
-              >搜索</el-button
-            >
-          </div>
-        </el-col>
-      </el-row>
-    </el-card>
-    <el-card shadow="never" class="mt-4">
-      <div>
-        <el-table :data="state.tableData" style="width: 100%">
-          <el-table-column prop="createdAt" label="提交时间"> </el-table-column>
-          <el-table-column prop="name" label="需求类型">
-            <template #default="{ row }">
-              {{ row.category.name }}
-            </template>
-          </el-table-column>
-          <el-table-column prop="name" label="需求状态">
-            <template #default="{ row }">
-              <el-tag v-if="!row.status" type="danger">待处理</el-tag>
-              <el-tag v-else-if="row.status == 2" type="success">已处理</el-tag>
-              <el-tag v-else>处理中</el-tag>
-            </template>
-          </el-table-column>
-          <el-table-column prop="processorName" label="服务商">
-          </el-table-column>
-          <el-table-column prop="name" label="提交人信息" width="350">
-            <template #default="{ row }">
-              <div class="flex items-center">
-                <el-text>姓名: </el-text>
-                <el-text tag="b">{{ row.archive.name }} </el-text>
-                (<el-text tag="b">{{ row.archiveSn }}</el-text>
-                <el-tooltip
-                  class="box-item"
-                  effect="dark"
-                  content="复制"
-                  placement="top"
-                >
-                  <ComponentCopy
-                    :content="row.archiveSn"
-                  ></ComponentCopy> </el-tooltip
-                >)
-              </div>
-              <div class="mt-2 flex items-center">
-                <el-text>性别:</el-text>
-                <el-tag type="" v-if="row.archive.gender == 1" effect="plain"
-                  >男</el-tag
-                >
-                <el-tag type="danger" v-else effect="plain">女</el-tag>
-              </div>
-              <div class="mt-2 flex items-center">
-                <el-text>年龄:</el-text>
-                <el-text tag="b">{{ formatAge(row.archive.birthday) }}</el-text>
-              </div>
-            </template>
-          </el-table-column>
-          <el-table-column prop="name" label="提交人手机号">
-            <template #default="{ row }">
-              <el-row class="flex items-center" v-if="row.mobile"
-                >{{ row.mobile }}
-                <el-tooltip
-                  class="box-item"
-                  effect="dark"
-                  content="复制"
-                  placement="top"
-                >
-                  <ComponentCopy
-                    :content="row.mobile"
-                  ></ComponentCopy> </el-tooltip
-              ></el-row>
-              <span v-else>-</span>
-            </template>
-          </el-table-column>
-          <el-table-column prop="" label="提交人住址" width="250">
-            <template #default="{ row }">
-              <el-text v-if="row.archive?.community">
-                {{
-                  row.archive?.province +
-                  row.archive?.city +
-                  row.archive?.area +
-                  row.archive?.subDistrict +
-                  row.archive?.community +
-                  row.archive?.village +
-                  row.archive?.building +
-                  row.archive?.houseNumber
-                }}
-              </el-text>
-              <el-text v-else>-</el-text>
-            </template>
-          </el-table-column>
-          <el-table-column prop="" label="需求内容">
-            <template #default="{ row }">
-              {{ row.content }}
-            </template>
-          </el-table-column>
-          <el-table-column prop="" label="操作">
-            <template #default="{ row }">
-              <el-button type="primary" link @click="handleEdit(row)"
-                >处理</el-button
-              >
-              <el-popconfirm title="是否确定删除?" @confirm="handleDelete(row)">
-                <template #reference>
-                  <el-button type="danger" link :disabled="row.source != 1"
-                    >删除</el-button
-                  >
-                </template>
-              </el-popconfirm>
-            </template>
-          </el-table-column>
-        </el-table>
-        <el-pagination
-          class="mt-4 justify-end"
-          background
-          layout="prev, pager, next"
-          :total="state.pagination.total"
-          @current-change="changePage"
-        />
-      </div>
-    </el-card>
-    <ComponentDialogEditDemand
-      v-model:show="state.visible"
-      :rowData="state.rowData"
-      @success="getTableData"
-    ></ComponentDialogEditDemand>
-    <ComponentDialogHandle
-      v-model:show="state.visibleHandle"
-      :rowData="state.rowData"
-      @success="getTableData"
-    ></ComponentDialogHandle>
-  </div>
-</template>
-<script lang="ts" setup>
-import { request, formatAge } from "@/utils";
-import { ElMessage, ElMessageBox } from "element-plus";
-import { ref, reactive } from "vue";
-import ComponentDialogEditDemand from "./components/DialogEditDemand.vue";
-import ComponentDialogHandle from "./components/DialogHandle.vue";
-import ComponentCopy from "@/components/Copy/index.vue";
-
-import { Search } from "@element-plus/icons-vue";
-
-const state = reactive({
-  query: {
-    status: undefined,
-    page: 1,
-    pageSize: 15,
-    searchKey: "name",
-    search: ""
-  },
-  pagination: {
-    total: 0
-  },
-  tableData: [],
-  visible: false,
-  visibleHandle: false,
-  rowData: {},
-  statusList: [
-    {
-      value: 0,
-      label: "待处理"
-    },
-    {
-      value: 1,
-      label: "处理中"
-    },
-    {
-      value: 2,
-      label: "已处理"
-    }
-  ]
-});
-const init = () => {
-  getTableData();
-};
-const onSearch = () => {
-  state.query.page = 1;
-  getTableData();
-};
-const getTableData = () => {
-  request
-    .get("articleService/demand/paginate", {
-      params: state.query
-    })
-    .then(resp => {
-      state.tableData = resp?.data.list;
-      state.pagination.total = resp.data.total;
-    });
-};
-
-const updateSort = async row => {
-  let resp = await request.post("/articleService/demand/category/sort", {
-    id: row.id,
-    sort: row.sort
-  });
-  ElMessage.success(resp.message);
-  getTableData();
-};
-
-const onChangeStatus = row => {
-  ElMessageBox.confirm(
-    row.status ? "确定要启用此类别吗?" : "确定要关闭此类别吗?",
-    "",
-    {
-      distinguishCancelAndClose: true,
-      confirmButtonText: "确定",
-      cancelButtonText: "取消"
-    }
-  )
-    .then(async () => {
-      await request.post("/articleService/demand/category/status", row);
-      ElMessage.success("操作成功");
-      getTableData();
-    })
-    .catch(err => {
-      row.status = row.status ? 0 : 1;
-    });
-};
-const handleCreate = () => {
-  state.visible = true;
-  state.rowData = {};
-  console.log("state.rowData", state.rowData);
-};
-const handleEdit = row => {
-  state.visibleHandle = true;
-  state.rowData = row;
-};
-const handleDelete = row => {
-  request.post("articleService/demand/delete", { id: row.id }).then(resp => {
-    ElMessage.success(resp.message);
-    getTableData();
-  });
-};
-const changePage = page => {
-  state.query.page = page;
-  getTableData();
-};
-init();
-</script>

+ 0 - 387
src/views/myShop/AddGood copy.vue

@@ -1,387 +0,0 @@
-<template>
-  <div class="add">
-    <el-card class="add-container">
-      <el-form
-        :model="state.goodForm"
-        :rules="state.rules"
-        ref="goodRef"
-        label-width="140px"
-        class="goodForm"
-      >
-        <el-form-item required label="商品所属店铺">
-          <el-select
-            style="width: 300px"
-            v-model="state.goodForm.shopIds"
-            filterable
-            clearable
-            placeholder="请选择店铺"
-          >
-            <el-option
-              v-for="item in state.shopList"
-              :key="item.id"
-              :label="item.name"
-              :value="item.id"
-            />
-          </el-select>
-        </el-form-item>
-        <el-form-item required label="商品分类">
-          <el-select
-            style="width: 300px"
-            v-model="state.goodForm.goodsCategoryId"
-            filterable
-            clearable
-            placeholder="请选择分类"
-          >
-            <el-option
-              v-for="item in categoryList"
-              :key="item.categoryId"
-              :label="item.categoryName"
-              :value="item.categoryId"
-            />
-          </el-select>
-        </el-form-item>
-        <el-form-item label="商品名称" prop="goodsName">
-          <el-input
-            style="width: 300px"
-            v-model="state.goodForm.goodsName"
-            placeholder="请输入商品名称"
-          ></el-input>
-        </el-form-item>
-        <el-form-item label="商品简介" prop="goodsIntro">
-          <el-input
-            style="width: 300px"
-            type="textarea"
-            v-model="state.goodForm.goodsIntro"
-            placeholder="请输入商品简介(100字)"
-          ></el-input>
-        </el-form-item>
-        <el-form-item label="商品价格" prop="originalPrice">
-          <el-input
-            min="0"
-            style="width: 300px"
-            v-model="state.goodForm.originalPrice"
-            placeholder="请输入商品价格"
-          ></el-input>
-        </el-form-item>
-        <el-form-item label="商品售卖价" prop="sellingPrice">
-          <el-input
-            min="0"
-            style="width: 300px"
-            v-model="state.goodForm.sellingPrice"
-            placeholder="请输入商品售价"
-          ></el-input>
-        </el-form-item>
-        <el-form-item label="商品库存" prop="stockNum">
-          <el-input
-            type="number"
-            min="0"
-            style="width: 300px"
-            v-model="state.goodForm.stockNum"
-            placeholder="请输入商品库存"
-          ></el-input>
-        </el-form-item>
-        <el-form-item label="商品标签" prop="tag">
-          <el-input
-            style="width: 300px"
-            v-model="state.goodForm.tag"
-            placeholder="请输入商品小标签"
-          ></el-input>
-        </el-form-item>
-        <el-form-item label="上架状态" prop="goodsSellStatus">
-          <el-radio-group v-model="state.goodForm.goodsSellStatus">
-            <el-radio label="0">上架</el-radio>
-            <el-radio label="1">下架</el-radio>
-          </el-radio-group>
-        </el-form-item>
-
-        <el-form-item label="交易方式">
-          <el-radio-group v-model="state.goodForm.tradeType">
-            <el-radio :label="0">线下</el-radio>
-            <el-radio :label="1">线上</el-radio>
-          </el-radio-group>
-        </el-form-item>
-
-        <el-form-item required label="商品主图" prop="goodsCoverImg">
-          <el-upload
-            class="avatar-uploader"
-            :show-file-list="false"
-            :before-upload="beforeAvatarUpload"
-            :http-request="simpleImgHttpUpload"
-          >
-            <img
-              v-if="state.goodForm.goodsCoverImg"
-              :src="state.goodForm.goodsCoverImg"
-              class="avatar"
-            />
-            <el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
-          </el-upload>
-        </el-form-item>
-        <el-form-item label="详情内容" prop="goodsDetailContent">
-          <Editor v-model:value="state.goodForm.goodsDetailContent"></Editor>
-        </el-form-item>
-        <el-form-item>
-          <el-button type="primary" @click="submitAdd()">{{
-            state.id ? "立即修改" : "立即创建"
-          }}</el-button>
-        </el-form-item>
-      </el-form>
-    </el-card>
-  </div>
-</template>
-
-<script lang="ts" setup>
-import {
-  reactive,
-  ref,
-  onMounted,
-  onBeforeUnmount,
-  getCurrentInstance
-} from "vue";
-import { request, uploadToOSS } from "@/utils/index";
-import { ElMessage } from "element-plus";
-import type { UploadProps } from "element-plus";
-import { Plus } from "@element-plus/icons-vue";
-import Editor from "@/components/Editor.vue";
-import { useRoute, useRouter } from "vue-router";
-
-const { proxy } = getCurrentInstance();
-const editor = ref(null);
-const goodRef = ref(null);
-const route = useRoute();
-const router = useRouter();
-const { id } = route.query;
-const state = reactive({
-  id: id,
-  defaultCate: "",
-  shopList: [],
-  goodForm: {
-    shopIds: undefined,
-    goodsName: "",
-    goodsCategoryId: undefined,
-    goodsIntro: "",
-    originalPrice: "",
-    sellingPrice: "",
-    stockNum: "",
-    goodsSellStatus: "0",
-    goodsCoverImg: "",
-    goodsDetailContent: "",
-    tradeType: 0,
-    tag: ""
-  },
-  rules: {
-    shopIds: [
-      { required: "true", message: "请选择商品所属店铺", trigger: ["change"] }
-    ],
-    goodsName: [
-      { required: "true", message: "请填写商品名称", trigger: ["change"] }
-    ],
-    originalPrice: [
-      { required: "true", message: "请填写商品价格", trigger: ["change"] }
-    ],
-    sellingPrice: [
-      { required: "true", message: "请填写商品售价", trigger: ["change"] }
-    ],
-    stockNum: [
-      { required: "true", message: "请填写商品库存", trigger: ["change"] }
-    ],
-    // tag: [{ required: "true", message: "请填写商品标签", trigger: ["change"] }],
-    goodsCoverImg: [
-      { required: "true", message: "请上传商品图片", trigger: ["change"] }
-    ],
-    goodsDetailContent: [
-      { required: "true", message: "请填写详情内容", trigger: ["change"] }
-    ]
-  },
-  categoryId: "",
-  category: {
-    lazy: true,
-    lazyLoad(node, resolve) {
-      const { level = 0, value } = node;
-      request
-        .get("/mallService/mechanism/category", {
-          params: {
-            page: 1,
-            pageSize: 1000,
-            categoryLevel: level + 1,
-            parentId: value || 0
-          }
-        })
-        .then(res => {
-          const list = res.data.list;
-          const nodes = list.map(item => ({
-            value: item.categoryId,
-            label: item.categoryName,
-            leaf: level > 1
-          }));
-          resolve(nodes);
-        });
-    }
-  }
-});
-const categoryList = ref([]);
-let instance;
-const getShopList = () => {
-  request
-    .get("/articleService/serviceProvider/shop/paginate", {
-      params: {
-        page: 1,
-        pageSize: 9999,
-        type: -1,
-        status: -1
-      }
-    })
-    .then(resp => {
-      state.shopList = resp.data.list;
-    });
-};
-onMounted(async () => {
-  console.log("加载成功");
-
-  await initCategory();
-  getShopList();
-  if (id) {
-    request.get(`/mallService/mechanism/goods/${id}`).then(res => {
-      const {
-        goods,
-        firstCategory,
-        secondCategory,
-        thirdCategory,
-        category,
-        shopIds,
-        tradeType
-      } = res?.data;
-      state.goodForm = {
-        shopIds: shopIds?.[0] || undefined,
-        goodsName: goods.goodsName,
-        goodsIntro: goods.goodsIntro,
-        originalPrice: goods.originalPrice / 100,
-        sellingPrice: goods.sellingPrice / 100,
-        stockNum: goods.stockNum,
-        goodsSellStatus: String(goods.goodsSellStatus),
-        goodsCoverImg: goods.goodsCoverImg,
-        tag: goods.tag,
-        goodsDetailContent: goods.goodsDetailContent,
-        tradeType: tradeType,
-        goodsCategoryId: category.categoryId
-      };
-      state.categoryId = goods.goodsCategoryId;
-      state.defaultCate = `${firstCategory?.categoryName}/${secondCategory?.categoryName}/${thirdCategory.categoryName}`;
-      if (instance) {
-        // 初始化商品详情 html
-        // instance.txt.html(goods.goodsDetailContent);
-      }
-    });
-  }
-});
-onBeforeUnmount(() => {
-  // instance.destroy();
-  instance = null;
-});
-const initCategory = () => {
-  return new Promise(resolve => {
-    request
-      .get("/mallService/mechanism/category", {
-        params: {
-          page: 1,
-          pageSize: 1000
-        }
-      })
-      .then(res => {
-        const list = res.data.list;
-        categoryList.value = list;
-        resolve();
-      });
-  });
-};
-const submitAdd = () => {
-  goodRef.value.validate(vaild => {
-    if (vaild) {
-      // 默认新增用 post 方法
-      let params = {
-        shopIds: [state.goodForm.shopIds],
-        goodsCategoryId: Number(state.goodForm.goodsCategoryId),
-        goodsCoverImg: state.goodForm.goodsCoverImg,
-        goodsDetailContent: state.goodForm.goodsDetailContent,
-        goodsIntro: state.goodForm.goodsIntro,
-        goodsName: state.goodForm.goodsName,
-        goodsSellStatus: Number(state.goodForm.goodsSellStatus),
-        originalPrice: Number(state.goodForm.originalPrice) * 100,
-        sellingPrice: Number(state.goodForm.sellingPrice) * 100,
-        stockNum: Number(state.goodForm.stockNum),
-        tag: state.goodForm.tag,
-        tradeType: state.goodForm.tradeType
-      };
-      console.log("params", params);
-      if (id) {
-        params.goodsId = Number(id);
-        // 修改商品使用 put 方法
-        request.put("/mallService/mechanism/goods", params).then(resp => {
-          ElMessage.success(resp.message);
-          router.push({ path: "/shop/goods" });
-        });
-      } else {
-        request.post("/mallService/mechanism/goods", params).then(resp => {
-          ElMessage.success(resp.message);
-          router.push({ path: "/shop/goods" });
-        });
-      }
-    }
-  });
-};
-const handleBeforeUpload = file => {
-  const sufix = file.name.split(".")[1] || "";
-  if (!["jpg", "jpeg", "png"].includes(sufix)) {
-    ElMessage.error("请上传 jpg、jpeg、png 格式的图片");
-    return false;
-  }
-};
-const handleUrlSuccess = val => {
-  state.goodForm.goodsCoverImg = val.data || "";
-};
-const handleChangeCate = val => {
-  state.categoryId = val[2] || 0;
-};
-
-const beforeAvatarUpload: UploadProps["beforeUpload"] = rawFile => {
-  if (!["image/png", "image/jpeg"].includes(rawFile.type)) {
-    ElMessage.error("Avatar picture must be JPG format!");
-    return false;
-  } else if (rawFile.size / 1024 / 1024 > 2) {
-    ElMessage.error("Avatar picture size can not exceed 2MB!");
-    return false;
-  }
-  return true;
-};
-
-const simpleImgHttpUpload = options => {
-  console.log("options", options);
-  uploadToOSS(options.file, options.file.name).then(resp => {
-    state.goodForm.goodsCoverImg = resp;
-  });
-};
-</script>
-
-<style scoped>
-.add {
-  display: flex;
-}
-.add-container {
-  flex: 1;
-  height: 100%;
-}
-.avatar-uploader {
-  width: 160px;
-  height: 160px;
-  color: #ddd;
-  font-size: 30px;
-}
-.avatar-uploader-icon {
-  display: block;
-  width: 160px;
-  height: 160px;
-  border: 1px solid #e9e9e9;
-  padding: 32px 17px;
-  display: flex;
-  justify-content: center;
-}
-</style>

+ 0 - 476
src/views/myShop/AddGood.vue

@@ -1,476 +0,0 @@
-<template>
-  <div class="add">
-    <el-card class="add-container">
-      <el-form
-        :model="state.goodForm"
-        :rules="state.rules"
-        ref="goodRef"
-        label-width="140px"
-        class="goodForm"
-      >
-        <el-form-item required label="商品所属店铺">
-          <el-select
-            style="width: 300px"
-            v-model="state.goodForm.shopIds"
-            filterable
-            clearable
-            placeholder="请选择店铺"
-            @change="getShopDeatil"
-          >
-            <el-option
-              v-for="item in state.shopList"
-              :key="item.id"
-              :label="item.name"
-              :value="item.id"
-            />
-          </el-select>
-        </el-form-item>
-        <el-form-item required label="商品分类">
-          <!-- <el-select
-            style="width: 300px"
-            v-model="state.goodForm.goodsCategoryId"
-            filterable
-            clearable
-            placeholder="请选择分类"
-          >
-            <el-option
-              v-for="item in categoryList"
-              :key="item.categoryId"
-              :label="item.categoryName"
-              :value="item.categoryId"
-            />
-          </el-select> -->
-          <el-cascader
-            :props="props"
-            collapse-tags
-            clearable
-            v-model="state.goodForm.goodsCategoryId"
-          ></el-cascader>
-        </el-form-item>
-        <el-form-item label="商品名称" prop="goodsName">
-          <el-input
-            style="width: 300px"
-            v-model="state.goodForm.goodsName"
-            placeholder="请输入商品名称"
-          ></el-input>
-        </el-form-item>
-        <el-form-item label="商品简介" prop="goodsIntro">
-          <el-input
-            style="width: 300px"
-            type="textarea"
-            v-model="state.goodForm.goodsIntro"
-            placeholder="请输入商品简介(100字)"
-          ></el-input>
-        </el-form-item>
-        <el-form-item label="商品价格" prop="originalPrice">
-          <el-input
-            min="0"
-            style="width: 300px"
-            v-model="state.goodForm.originalPrice"
-            placeholder="请输入商品价格"
-          ></el-input>
-        </el-form-item>
-        <el-form-item label="商品售卖价" prop="sellingPrice">
-          <el-input
-            min="0"
-            style="width: 300px"
-            v-model="state.goodForm.sellingPrice"
-            placeholder="请输入商品售价"
-          ></el-input>
-        </el-form-item>
-        <el-form-item label="商品库存" prop="stockNum">
-          <el-input
-            type="number"
-            min="0"
-            style="width: 300px"
-            v-model="state.goodForm.stockNum"
-            placeholder="请输入商品库存"
-          ></el-input>
-        </el-form-item>
-        <el-form-item label="商品标签" prop="tag">
-          <el-input
-            style="width: 300px"
-            v-model="state.goodForm.tag"
-            placeholder="请输入商品小标签"
-          ></el-input>
-        </el-form-item>
-        <el-form-item label="上架状态" prop="goodsSellStatus">
-          <el-radio-group v-model="state.goodForm.goodsSellStatus">
-            <el-radio label="0">上架</el-radio>
-            <el-radio label="1">下架</el-radio>
-          </el-radio-group>
-        </el-form-item>
-
-        <el-form-item label="交易方式">
-          <el-radio-group v-model="state.goodForm.tradeType">
-            <el-radio :label="0" :disabled="state.shopDetail.tradeType === 1"
-              >线下</el-radio
-            >
-            <el-radio :label="1" :disabled="state.shopDetail.tradeType === 0"
-              >线上</el-radio
-            >
-            <!-- <el-radio :label="2" :disabled="state.shopDetail.tradeType === 2"
-              >根据商品情况自行设定</el-radio
-            > -->
-          </el-radio-group>
-        </el-form-item>
-
-        <el-form-item required label="商品主图" prop="goodsCoverImg">
-          <el-upload
-            class="avatar-uploader"
-            :show-file-list="false"
-            :before-upload="beforeAvatarUpload"
-            :http-request="simpleImgHttpUpload"
-          >
-            <img
-              v-if="state.goodForm.goodsCoverImg"
-              :src="state.goodForm.goodsCoverImg"
-              class="avatar"
-            />
-            <el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
-          </el-upload>
-        </el-form-item>
-        <el-form-item label="详情内容" prop="goodsDetailContent">
-          <div>
-            <el-button
-              v-if="state.goodForm.detailType"
-              @click="state.goodForm.detailType = 0"
-              >重新设置</el-button
-            >
-            <div
-              v-if="
-                state.goodForm.detailType == 0 || !state.goodForm.detailType
-              "
-            >
-              <Editor
-                v-model:value="state.goodForm.goodsDetailContent"
-              ></Editor>
-            </div>
-            <div v-if="state.goodForm.detailType == 2">
-              <el-image :src="state.goodForm.goodsDetailContent" fit="fill" />
-            </div>
-
-            <div v-if="state.goodForm.detailType == 1">
-              <el-text>{{ state.goodForm.goodsDetailContent }}</el-text>
-            </div>
-          </div>
-        </el-form-item>
-        <el-form-item>
-          <el-button type="primary" @click="submitAdd()">{{
-            state.id ? "立即修改" : "立即创建"
-          }}</el-button>
-        </el-form-item>
-      </el-form>
-    </el-card>
-  </div>
-</template>
-
-<script lang="ts" setup>
-import {
-  reactive,
-  ref,
-  onMounted,
-  onBeforeUnmount,
-  getCurrentInstance
-} from "vue";
-import { request, uploadToOSS } from "@/utils/index";
-import { ElMessage } from "element-plus";
-import type { UploadProps } from "element-plus";
-import { Plus } from "@element-plus/icons-vue";
-import Editor from "@/components/Editor.vue";
-import { useRoute, useRouter } from "vue-router";
-
-const { proxy } = getCurrentInstance();
-const editor = ref(null);
-const goodRef = ref(null);
-const route = useRoute();
-const router = useRouter();
-const { id } = route.query;
-const state = reactive({
-  id: id,
-  defaultCate: "",
-  shopList: [],
-  shopDetail: {},
-  goodForm: {
-    DetailType: 0,
-    shopIds: undefined,
-    goodsName: "",
-    goodsCategoryId: undefined,
-    goodsIntro: "",
-    originalPrice: "",
-    sellingPrice: "",
-    stockNum: "",
-    goodsSellStatus: "0",
-    goodsCoverImg: "",
-    goodsDetailContent: "",
-    tradeType: 0,
-    tag: ""
-  },
-  rules: {
-    shopIds: [
-      { required: "true", message: "请选择商品所属店铺", trigger: ["change"] }
-    ],
-    goodsName: [
-      { required: "true", message: "请填写商品名称", trigger: ["change"] }
-    ],
-    originalPrice: [
-      { required: "true", message: "请填写商品价格", trigger: ["change"] }
-    ],
-    sellingPrice: [
-      { required: "true", message: "请填写商品售价", trigger: ["change"] }
-    ],
-    stockNum: [
-      { required: "true", message: "请填写商品库存", trigger: ["change"] }
-    ],
-    // tag: [{ required: "true", message: "请填写商品标签", trigger: ["change"] }],
-    goodsCoverImg: [
-      { required: "true", message: "请上传商品图片", trigger: ["change"] }
-    ],
-    goodsDetailContent: [
-      { required: "true", message: "请填写详情内容", trigger: ["change"] }
-    ]
-  },
-  categoryId: "",
-  category: {
-    lazy: true,
-    lazyLoad(node, resolve) {
-      const { level = 0, value } = node;
-      request
-        .get("/mallService/mechanism/category", {
-          params: {
-            page: 1,
-            pageSize: 1000,
-            categoryLevel: level + 1,
-            parentId: value || 0
-          }
-        })
-        .then(res => {
-          const list = res.data.list;
-          const nodes = list.map(item => ({
-            value: item.categoryId,
-            label: item.categoryName,
-            leaf: level > 1
-          }));
-          resolve(nodes);
-        });
-    }
-  }
-});
-const categoryList = ref([]);
-const props = {
-  lazy: true,
-  lazyLoad(node, resolve) {
-    const { level, value } = node;
-    console.log("node", node);
-    request
-      .get("/mallService/mechanism/category", {
-        params: {
-          page: 1,
-          pageSize: 1000,
-          parentId: value
-        }
-      })
-      .then(resp => {
-        let nodes = resp.data.list.map(v => {
-          return {
-            ...v,
-            value: v.categoryId,
-            label: v.categoryName,
-            leaf: level >= 1
-          };
-        });
-
-        resolve(nodes);
-      });
-
-    // setTimeout(() => {
-    //   const nodes = Array.from({ length: level + 1 }).map((item) => ({
-    //     value: ++id,
-    //     label: `Option - ${id}`,
-    //     leaf: level >= 2,
-    //   }))
-    //   // Invoke `resolve` callback to return the child nodes data and indicate the loading is finished.
-    //   resolve(nodes)
-    // }, 1000)
-  }
-};
-
-let instance;
-const getShopList = () => {
-  request
-    .get("/articleService/serviceProvider/staff/shop/paginate", {
-      params: {
-        page: 1,
-        pageSize: 9999,
-        type: -1,
-        status: -1
-      }
-    })
-    .then(resp => {
-      state.shopList = resp.data.list;
-    });
-};
-const getShopDeatil = id => {
-  request.get(`/articleService/serviceProvider/shop?id=${id}`).then(resp => {
-    state.shopDetail = resp.data;
-  });
-};
-onMounted(async () => {
-  console.log("加载成功");
-
-  await initCategory();
-  getShopList();
-  state.goodForm.tradeType = state.shopDetail?.tradeType;
-
-  if (id) {
-    request.get(`/mallService/mechanism/goods/${id}`).then(res => {
-      const {
-        goods,
-        firstCategory,
-        secondCategory,
-        thirdCategory,
-        category,
-        shopIds
-      } = res?.data;
-      state.goodForm = {
-        shopIds: shopIds?.[0] || undefined,
-        goodsName: goods.goodsName,
-        goodsIntro: goods.goodsIntro,
-        originalPrice: goods.originalPrice / 100,
-        sellingPrice: goods.sellingPrice / 100,
-        stockNum: goods.stockNum,
-        goodsSellStatus: String(goods.goodsSellStatus),
-        goodsCoverImg: goods.goodsCoverImg,
-        tag: goods.tag,
-        goodsDetailContent: goods.goodsDetailContent,
-        tradeType: goods.tradeType,
-        goodsCategoryId: category.categoryId,
-        detailType: goods.DetailType
-      };
-      state.categoryId = goods.goodsCategoryId;
-      state.defaultCate = `${firstCategory?.categoryName}/${secondCategory?.categoryName}/${thirdCategory?.categoryName}`;
-      getShopDeatil(shopIds[0]);
-      if (instance) {
-        // 初始化商品详情 html
-        // instance.txt.html(goods.goodsDetailContent);
-      }
-    });
-  }
-});
-onBeforeUnmount(() => {
-  // instance.destroy();
-  instance = null;
-});
-const initCategory = () => {
-  return new Promise(resolve => {
-    request
-      .get("/mallService/mechanism/category", {
-        params: {
-          page: 1,
-          pageSize: 1000
-        }
-      })
-      .then(res => {
-        const list = res.data.list;
-        categoryList.value = list;
-        resolve();
-      });
-  });
-};
-const submitAdd = () => {
-  goodRef.value.validate(vaild => {
-    if (vaild) {
-      // 默认新增用 post 方法
-      let params = {
-        shopIds: [state.goodForm.shopIds],
-        goodsCategoryId: Number(state.goodForm.goodsCategoryId),
-        goodsCoverImg: state.goodForm.goodsCoverImg,
-        goodsDetailContent: state.goodForm.goodsDetailContent,
-        goodsIntro: state.goodForm.goodsIntro,
-        goodsName: state.goodForm.goodsName,
-        goodsSellStatus: Number(state.goodForm.goodsSellStatus),
-        originalPrice: Number(
-          (Number(state.goodForm.originalPrice) * 100).toFixed(2)
-        ),
-        sellingPrice: Number(
-          (Number(state.goodForm.sellingPrice) * 100).toFixed(2)
-        ),
-        stockNum: Number(state.goodForm.stockNum),
-        tag: state.goodForm.tag,
-        tradeType: state.goodForm.tradeType,
-        detailType: state.goodForm.detailType
-      };
-      console.log("params", params);
-      if (id) {
-        params.goodsId = Number(id);
-        // 修改商品使用 put 方法
-        request.put("/mallService/mechanism/goods", params).then(resp => {
-          ElMessage.success(resp.message);
-          router.push({ path: "/shop/goods" });
-        });
-      } else {
-        request.post("/mallService/mechanism/goods", params).then(resp => {
-          ElMessage.success(resp.message);
-          router.push({ path: "/shop/goods" });
-        });
-      }
-    }
-  });
-};
-const handleBeforeUpload = file => {
-  const sufix = file.name.split(".")[1] || "";
-  if (!["jpg", "jpeg", "png"].includes(sufix)) {
-    ElMessage.error("请上传 jpg、jpeg、png 格式的图片");
-    return false;
-  }
-};
-const handleUrlSuccess = val => {
-  state.goodForm.goodsCoverImg = val.data || "";
-};
-const handleChangeCate = val => {
-  state.categoryId = val[2] || 0;
-};
-
-const beforeAvatarUpload: UploadProps["beforeUpload"] = rawFile => {
-  if (!["image/png", "image/jpeg"].includes(rawFile.type)) {
-    ElMessage.error("Avatar picture must be JPG format!");
-    return false;
-  } else if (rawFile.size / 1024 / 1024 > 2) {
-    ElMessage.error("Avatar picture size can not exceed 2MB!");
-    return false;
-  }
-  return true;
-};
-
-const simpleImgHttpUpload = options => {
-  console.log("options", options);
-  uploadToOSS(options.file, options.file.name).then(resp => {
-    state.goodForm.goodsCoverImg = resp;
-  });
-};
-</script>
-
-<style scoped>
-.add {
-  display: flex;
-}
-.add-container {
-  flex: 1;
-  height: 100%;
-}
-.avatar-uploader {
-  width: 160px;
-  height: 160px;
-  color: #ddd;
-  font-size: 30px;
-}
-.avatar-uploader-icon {
-  display: block;
-  width: 160px;
-  height: 160px;
-  border: 1px solid #e9e9e9;
-  padding: 32px 17px;
-  display: flex;
-  justify-content: center;
-}
-</style>

+ 0 - 355
src/views/myShop/Appeal.vue

@@ -1,355 +0,0 @@
-<template>
-  <el-card class="order-container">
-    <template #header>
-      <div class="header flex items-center flex-wrap">
-        <div class="flex justify-end flex-1">
-          <el-select
-            v-model="complaintFilter.status"
-            @change="
-              complaintFilter.page = 1;
-              getComplaintList();
-            "
-          >
-            <el-option label="全部" :value="-1"></el-option>
-            <el-option
-              v-for="(item, index) in complaintStatusToText"
-              :key="index"
-              :label="item"
-              :value="index"
-            ></el-option>
-          </el-select>
-          <el-button
-            class="ml-2"
-            type="primary"
-            plain
-            @click="
-              complaintFilter.page = 1;
-              getComplaintList();
-            "
-            >搜索</el-button
-          >
-        </div>
-      </div>
-    </template>
-    <el-table :data="complaintList">
-      <el-table-column label="订单编号" prop="orderNo"></el-table-column>
-      <el-table-column label="投诉时间" prop="createAt"></el-table-column>
-      <el-table-column label="投诉处理状态">
-        <template #default="{ row }">
-          <span
-            :class="
-              [
-                'text-orange-500',
-                'text-blue-500',
-                'text-red-500',
-                'text-green-500'
-              ][row.status]
-            "
-            >{{ complaintStatusToText[row.status] }}</span
-          >
-        </template>
-      </el-table-column>
-      <el-table-column label="操作">
-        <template #default="{ row }">
-          <el-button
-            type="primary"
-            link
-            @click="
-              router.push({
-                path: '/myShop/order/detail',
-                query: { id: row.orderNo }
-              })
-            "
-            >查看</el-button
-          >
-        </template>
-      </el-table-column>
-    </el-table>
-    <el-pagination
-      class="mt-4 justify-end"
-      background
-      layout="total, prev, pager, next"
-      :total="complaintTotal"
-      :page-size="complaintFilter.pageSize"
-      @current-change="
-        p => {
-          complaintFilter.page = p;
-          getComplaintList();
-        }
-      "
-    />
-  </el-card>
-</template>
-
-<script setup>
-import { onMounted, reactive, ref } from "vue";
-import { ElMessage } from "element-plus";
-import { HomeFilled, Delete } from "@element-plus/icons-vue";
-import { request } from "@/utils";
-import { useRouter } from "vue-router";
-const router = useRouter();
-const state = reactive({
-  loading: false,
-  tableData: [], // 数据列表
-  multipleSelection: [], // 选中项
-  total: 0, // 总条数
-  currentPage: 1, // 当前页
-  pageSize: 10, // 分页大小
-  orderNo: "", // 订单号
-  orderStatus: -1, // 订单状态
-  tradeType: -1, // 交易方式
-  shopList: [],
-  shopId: -1,
-  payType: -1,
-  // 订单状态筛选项默认值
-  options: [
-    {
-      value: -1,
-      label: "全部"
-    },
-    {
-      value: 0,
-      label: "待支付"
-    },
-    {
-      value: 1,
-      label: "已支付"
-    },
-    // {
-    //   value: 2,
-    //   label: "配货完成"
-    // },
-    {
-      value: 3,
-      label: "已发货"
-    },
-    {
-      value: 4,
-      label: "交易成功"
-    },
-    {
-      value: 5,
-      label: "用户关闭"
-    },
-    {
-      value: 6,
-      label: "超时关闭"
-    },
-    {
-      value: 7,
-      label: "商家关闭"
-    }
-  ]
-});
-const tradeTypeList = [
-  {
-    k: "线下",
-    v: 0
-  },
-  {
-    k: "线上",
-    v: 1
-  }
-];
-const payTypeList = {
-  1: {
-    k: "支付宝支付",
-    v: 1
-  },
-  2: {
-    k: "微信支付",
-    v: 2
-  },
-  9: {
-    k: "其他",
-    v: 9
-  }
-};
-const orderStatus = {
-  0: "待支付",
-  1: "已支付",
-  3: "出库成功",
-  4: "交易成功",
-  5: "用户关闭",
-  6: "超时关闭",
-  7: "商家关闭"
-};
-// 初始化获取订单列表
-onMounted(() => {
-  getOrderList();
-  // getShopList();
-});
-
-const farmatOrderMap = status => {
-  return orderStatus[status] || "未知状态";
-};
-
-const getShopList = () => {
-  request
-    .get("/articleService/serviceProvider/shop/paginate", {
-      params: {
-        page: 1,
-        pageSize: 9999,
-        type: -1,
-        status: -1
-      }
-    })
-    .then(resp => {
-      state.shopList = resp.data.list;
-    });
-};
-
-// 获取列表方法
-const getOrderList = () => {
-  state.loading = true;
-  request
-    .get("/mallService/mechanism/staff/orders", {
-      params: {
-        page: state.currentPage,
-        pageSize: state.pageSize,
-        orderNo: state.orderNo,
-        orderStatus: state.orderStatus,
-        tradeType: state.tradeType,
-        shopId: state.shopId,
-        payType: state.payType
-      }
-    })
-    .then(res => {
-      state.tableData = res.data.list;
-      state.total = res.data.total;
-    });
-};
-// 触发过滤项方法
-const handleOption = () => {
-  state.currentPage = 1;
-  getOrderList();
-};
-// checkbox 选择项
-const handleSelectionChange = val => {
-  state.multipleSelection = val;
-};
-// 翻页方法
-const changePage = val => {
-  state.currentPage = val;
-  getOrderList();
-};
-// 完成订单
-const handleCompleteOrder = ids => {
-  request
-    .put("/mallService/mechanism/orders/complete", {
-      ids
-    })
-    .then(resp => {
-      ElMessage.success(resp.message);
-      getOrderList();
-    });
-};
-// 配货方法
-const handleConfig = id => {
-  let params;
-  // 当个配置
-  if (id) {
-    params = [id];
-  } else {
-    if (!state.multipleSelection.length) {
-      console.log("state.multipleSelection", state.multipleSelection.length);
-      ElMessage.error("请选择项");
-      return;
-    }
-    // 多选配置
-    params = state.multipleSelection.map(i => i.orderId);
-  }
-  request
-    .put("/mallService/mechanism/orders/checkDone", {
-      ids: params
-    })
-    .then(() => {
-      ElMessage.success("配货成功");
-      getOrderList();
-    });
-};
-// 出库方法
-const handleSend = id => {
-  let params;
-  if (id) {
-    params = [id];
-  } else {
-    if (!state.multipleSelection.length) {
-      ElMessage.error("请选择项");
-      return;
-    }
-    params = state.multipleSelection.map(i => i.orderId);
-  }
-  request
-    .put("/mallService/mechanism/orders/checkOut", {
-      ids: params
-    })
-    .then(() => {
-      ElMessage.success("出库成功");
-      getOrderList();
-    });
-};
-// 关闭订单方法
-const handleClose = id => {
-  let params;
-  if (id) {
-    params = [id];
-  } else {
-    if (!state.multipleSelection.length) {
-      ElMessage.error("请选择项");
-      return;
-    }
-    params = state.multipleSelection.map(i => i.orderId);
-  }
-  request
-    .put("/mallService/mechanism/orders/close", {
-      ids: params
-    })
-    .then(() => {
-      ElMessage.success("关闭成功");
-      getOrderList();
-    });
-};
-const complaintStatusToText = {
-  0: "待商家处理",
-  1: "商家已处理",
-  2: "待平台处理",
-  3: "平台已处理"
-};
-const complaintVisible = ref(false);
-const complaintList = ref([]);
-const complaintWaitTotal = ref(0);
-const complaintTotal = ref(0);
-const complaintFilter = ref({
-  page: 1,
-  pageSize: 15,
-  status: -1,
-  isShop: 1
-});
-const getComplaintWaitTotal = async () => {
-  const { data } = await request.get(
-    `/mallService/mechanism/complaint/paginate`,
-    {
-      params: {
-        page: 1,
-        status: 2,
-        pageSize: 0,
-        isShop: 1
-      }
-    }
-  );
-  complaintWaitTotal.value = data.total;
-};
-const getComplaintList = async () => {
-  const { data } = await request.get(
-    `/mallService/mechanism/complaint/paginate`,
-    {
-      params: complaintFilter.value
-    }
-  );
-  complaintList.value = data.list;
-  complaintTotal.value = data.total;
-};
-getComplaintWaitTotal();
-getComplaintList();
-</script>

+ 0 - 213
src/views/myShop/Category.vue

@@ -1,213 +0,0 @@
-<template>
-  <el-card class="category-container">
-    <template #header>
-      <div class="header">
-        <el-button type="primary" :icon="Plus" @click="handleAdd"
-          >增加</el-button
-        >
-        <el-popconfirm
-          title="确定删除吗?"
-          confirmButtonText="确定"
-          cancelButtonText="取消"
-          @confirm="handleDelete"
-        >
-          <template #reference>
-            <el-button type="danger" :icon="Delete">批量删除</el-button>
-          </template>
-        </el-popconfirm>
-      </div>
-    </template>
-    <el-table
-      ref="multipleTable"
-      :data="state.tableData"
-      tooltip-effect="dark"
-      style="width: 100%"
-      @selection-change="handleSelectionChange"
-    >
-      <el-table-column type="selection" width="55"> </el-table-column>
-      <el-table-column prop="categoryName" label="分类名称"> </el-table-column>
-      <el-table-column prop="categoryRank" label="排序值" width="120">
-      </el-table-column>
-      <el-table-column prop="createTime" label="添加时间" width="200">
-      </el-table-column>
-      <el-table-column label="操作" width="350">
-        <template #default="scope">
-          <el-button
-            type="primary"
-            link
-            @click="handleEdit(scope.row.categoryId)"
-            >修改</el-button
-          >
-          <el-button
-            type="primary"
-            link
-            @click="handleEditSecondaryCategory(scope.row.categoryId)"
-            >二级类目管理</el-button
-          >
-          <el-popconfirm
-            title="确定删除吗?"
-            confirmButtonText="确定"
-            cancelButtonText="取消"
-            @confirm="handleDeleteOne(scope.row.categoryId)"
-          >
-            <template #reference>
-              <el-button type="danger">删除</el-button>
-            </template>
-          </el-popconfirm>
-        </template>
-      </el-table-column>
-    </el-table>
-    <!--总数超过一页,再展示分页器-->
-    <el-pagination
-      class="mt-4 justify-end"
-      background
-      layout="prev, pager, next"
-      :total="state.total"
-      :page-size="state.pageSize"
-      :current-page="state.currentPage"
-      @current-change="changePage"
-    />
-    <DialogAddCategory ref="addCate" :reload="getCategory" :type="state.type" />
-    <DialogSecondaryCategory
-      v-model:show="state.visibleSecondaryCategory"
-      :id="state.parent_id"
-    />
-  </el-card>
-</template>
-
-<script lang="ts" setup>
-import {
-  onMounted,
-  onUnmounted,
-  reactive,
-  ref,
-  toRefs,
-  watchEffect
-} from "vue";
-import { useRoute, useRouter } from "vue-router";
-import { ElMessage } from "element-plus";
-import { Plus, Delete } from "@element-plus/icons-vue";
-import { request } from "@/utils";
-import DialogAddCategory from "./components/DialogAddCategory.vue";
-import DialogSecondaryCategory from "./components/DialogSecondaryCategory.vue";
-
-const addCate = ref(null);
-const router = useRouter(); // 声明路由实例
-const route = useRoute(); // 获取路由参数
-const state = reactive({
-  loading: false,
-  tableData: [], // 数据列表
-  multipleSelection: [], // 选中项
-  total: 0, // 总条数
-  currentPage: 1, // 当前页
-  pageSize: 10, // 分页大小
-  type: "add", // 操作类型
-  level: 1,
-  parent_id: 0,
-  visibleSecondaryCategory: undefined // 二级类目管理
-});
-const multipleTable = ref(null);
-onMounted(() => {
-  getCategory();
-});
-watchEffect(() => {
-  console.log(state.pageSize);
-});
-const unwatch = router.afterEach(to => {
-  // 每次路由变化的时候,都会触发监听时间,重新获取列表数据
-  if (["category", "level2", "level3"].includes(to.name)) {
-    getCategory();
-  }
-});
-onUnmounted(() => {
-  unwatch();
-});
-// 获取分类列表
-const getCategory = () => {
-  const { level = 1, parent_id = 0 } = route.query;
-  state.loading = true;
-  request
-    .get("/mallService/mechanism/category", {
-      params: {
-        page: state.currentPage,
-        pageSize: state.pageSize,
-        categoryLevel: level,
-        parentId: parent_id
-      }
-    })
-    .then(res => {
-      state.tableData = res.data.list;
-      state.total = res.data.total;
-      state.loading = false;
-      state.level = level;
-    });
-};
-const changePage = val => {
-  state.currentPage = val;
-  getCategory();
-};
-const handleNext = item => {
-  const levelNumber = item.categoryLevel + 1;
-  if (levelNumber == 4) {
-    ElMessage.error("没有下一级");
-    return;
-  }
-  router.push({
-    name: `level${levelNumber}`,
-    query: {
-      level: levelNumber,
-      parent_id: item.categoryId
-    }
-  });
-};
-// 添加分类
-const handleAdd = () => {
-  state.type = "add";
-  addCate.value.open();
-};
-// 修改分类
-const handleEdit = id => {
-  state.type = "edit";
-  addCate.value.open(id);
-};
-
-//  修改二级类目
-const handleEditSecondaryCategory = id => {
-  state.visibleSecondaryCategory = true;
-  state.parent_id = id;
-};
-// 选择项
-const handleSelectionChange = val => {
-  state.multipleSelection = val;
-};
-// 批量删除
-const handleDelete = () => {
-  if (!state.multipleSelection.length) {
-    ElMessage.error("请选择项");
-    return;
-  }
-  request
-    .delete("/categories", {
-      data: {
-        ids: state.multipleSelection.map(i => i.categoryId)
-      }
-    })
-    .then(() => {
-      ElMessage.success("删除成功");
-      getCategory();
-    });
-};
-// 单个删除
-const handleDeleteOne = id => {
-  request
-    .delete("/mallService/mechanism/category", {
-      ids: [id]
-    })
-    .then(() => {
-      ElMessage.success("删除成功");
-      getCategory();
-    });
-};
-</script>
-
-<style></style>

+ 0 - 2
src/views/myShop/EditGoods.vue

@@ -1,2 +0,0 @@
-<template>测试x</template>
-<script lang="ts" setup></script>

+ 0 - 378
src/views/myShop/Goods.vue

@@ -1,378 +0,0 @@
-<template>
-  <div>
-    <el-card class="good-container">
-      <template #header>
-        <div class="header flex justify-between">
-          <el-button type="primary" :icon="Plus" @click="handleAdd"
-            >新增商品</el-button
-          >
-          <div>
-            <el-input
-              style="width: 400px"
-              class="ml-2 mr-2"
-              v-model="query.key"
-              clearable
-              placeholder="商品名称"
-            ></el-input>
-            <el-select v-model="query.goodsSellStatus" placeholder="选择状态">
-              <el-option label="全部状态" :value="-1"></el-option>
-              <el-option label="已上架" :value="0"></el-option>
-              <el-option label="已下架" :value="1"></el-option>
-            </el-select>
-            <el-select
-              v-model="query.goodsCategoryId"
-              filterable
-              class="ml-2"
-              placeholder="请选择分类"
-            >
-              <el-option label="全部商品分类" :value="-1"></el-option>
-
-              <el-option
-                v-for="item in categoryList"
-                :key="item.categoryId"
-                :label="item.categoryName"
-                :value="item.categoryId"
-              />
-            </el-select>
-
-            <!-- <el-select v-model="query.goodsSellStatus" placeholder="选择状态">
-            <el-option label="全部审核状态" :value="-1"></el-option>
-            <el-option label="带审核" :value="0"></el-option>
-            <el-option label="审核通过" :value="1"></el-option>
-            <el-option label="审核不通过" :value="2"></el-option>
-          </el-select> -->
-            <el-button type="primary" class="ml-2" @click="onSearch"
-              >搜索</el-button
-            >
-          </div>
-        </div>
-      </template>
-      <el-table
-        :load="state.loading"
-        :data="state.tableData"
-        tooltip-effect="dark"
-        style="width: 100%"
-      >
-        <!-- <el-table-column prop="mechanismId" label="商品编号"> </el-table-column> -->
-        <el-table-column prop="goodsName" label="商品名"> </el-table-column>
-        <el-table-column prop="goodsId" label="商品ID"> </el-table-column>
-        <el-table-column label="所属店铺">
-          <template #default="{ row }">
-            <span v-for="item in row.shops" :key="item.id">{{
-              item.name
-            }}</span>
-          </template>
-        </el-table-column>
-
-        <el-table-column prop="goodsCategoryName" label="所属分类">
-        </el-table-column>
-
-        <el-table-column prop="goodsIntro" label="商品简介"> </el-table-column>
-        <el-table-column label="商品图片" width="150px">
-          <template #default="scope">
-            <el-image
-              :src="scope.row.goodsCoverImg"
-              :preview-src-list="[scope.row.goodsCoverImg]"
-              preview-teleported
-              class="rounded"
-              mode="cover"
-              style="width: 100px; height: 100px"
-            ></el-image>
-          </template>
-        </el-table-column>
-        <el-table-column prop="stockNum" label="商品库存"> </el-table-column>
-        <el-table-column prop="sellingPrice" label="商品售价">
-          <template #default="scope">
-            {{ scope.row.sellingPrice / 100 }}
-          </template>
-        </el-table-column>
-        <el-table-column label="审核状态">
-          <template #default="scope">
-            <span :class="statusList[scope.row.verifyStatus].class"
-              >{{ statusList[scope.row.verifyStatus].label }}
-            </span>
-          </template>
-        </el-table-column>
-        <el-table-column label="上架状态">
-          <template #default="scope">
-            <span style="color: green" v-if="scope.row.goodsSellStatus == 0"
-              >销售中</span
-            >
-            <span style="color: red" v-else>已下架</span>
-          </template>
-        </el-table-column>
-
-        <el-table-column label="操作" width="240">
-          <template #default="scope">
-            <el-button
-              type="primary"
-              link
-              @click="handleEdit(scope.row.goodsId)"
-              >修改</el-button
-            >
-            <el-button
-              v-if="scope.row.goodsSellStatus == 0"
-              type="primary"
-              link
-              @click="handleStatus(scope.row.goodsId, 1)"
-              >下架</el-button
-            >
-            <el-button
-              v-else
-              type="primary"
-              link
-              @click="handleStatus(scope.row.goodsId, 0)"
-              >上架</el-button
-            >
-            <!-- <el-button
-              type="primary"
-              link
-              @click="handleExamine(scope.row.goodsId, 0)"
-              >审核</el-button
-            > -->
-            <el-button
-              type="primary"
-              link
-              @click="
-                getEvaluationList(scope.row.goodsId);
-                evaluationManageVisible = true;
-              "
-              >评价管理</el-button
-            >
-          </template>
-        </el-table-column>
-      </el-table>
-      <!--总数超过一页,再展示分页器-->
-      <el-pagination
-        class="mt-4 justify-end"
-        background
-        layout="prev, pager, next"
-        :total="state.total"
-        :page-size="state.pageSize"
-        :current-page="state.currentPage"
-        @current-change="changePage"
-      />
-    </el-card>
-    <DialogExamineGoods
-      v-model:show="state.visibleExamine"
-      :id="state.id"
-      @success="getGoodList"
-    ></DialogExamineGoods>
-
-    <el-dialog v-model="evaluationManageVisible" title="评价管理">
-      <div
-        class="shadow border-solid border border-gray-100 mb-2 bg-white rounded p-4"
-        v-for="(item, index) in evaluationList"
-        :key="index"
-      >
-        <div class="flex items-center mb-2">
-          <el-image
-            :src="item.userAvatar || man"
-            alt=""
-            class="w-12 h-12 rounded-full shadow bg-white mr-4"
-          />
-          <div class="flex-1">
-            <div>{{ item.userNickname }}</div>
-            <el-rate :model-value="item.level" disabled />
-          </div>
-          <!-- <el-button type="danger" plain @click="removeEvaluation(item)"
-            >删除评论</el-button
-          > -->
-        </div>
-        <div class="mb-2">
-          <span>评价时间</span>
-          <span class="ml-2 text-sm text-gray-800">{{ item.updateTime }}</span>
-        </div>
-        <div class="text-gray-500 text-sm break-all whitespace-pre-wrap">
-          {{ item.appraise }}
-        </div>
-      </div>
-      <el-empty v-if="!evaluationList.length"></el-empty>
-
-      <el-pagination
-        class="mt-4 justify-end"
-        background
-        layout="total, prev, pager, next"
-        :total="evaluationTotal"
-        :page-size="evaluationFilter.pageSize"
-        :current-page="evaluationFilter.page"
-        @current-change="
-          p => {
-            evaluationFilter.page = p;
-            getEvaluationList(evaluationFilter.goodsId);
-          }
-        "
-      />
-    </el-dialog>
-  </div>
-</template>
-
-<script setup>
-import { onMounted, reactive, getCurrentInstance, ref } from "vue";
-import { request } from "@/utils/http";
-import { ElMessage, ElMessageBox } from "element-plus";
-import { Plus, Delete } from "@element-plus/icons-vue";
-import { useRouter, useRoute } from "vue-router";
-import { relative } from "path";
-import DialogExamineGoods from "./components/DialogExamineGoods.vue";
-import man from "@/assets/icon-man.png";
-const app = getCurrentInstance();
-const route = useRoute();
-const router = useRouter();
-const state = reactive({
-  id: undefined,
-  loading: false,
-  tableData: [], // 数据列表
-  total: 0, // 总条数
-  currentPage: 1, // 当前页
-  pageSize: 10, // 分页大小
-  visibleExamine: false
-});
-const categoryList = ref([]);
-
-const statusList = [
-  {
-    label: "待审核",
-    value: 0
-  },
-  {
-    label: "审核通过",
-    value: 1,
-    class: "text-green-700"
-  },
-
-  {
-    label: "审核不通过",
-    value: 2,
-    class: "text-red-700"
-  }
-];
-const query = reactive({
-  key: "",
-  goodsSellStatus: -1,
-  shopId: -1
-});
-onMounted(() => {
-  onSearch();
-  initCategory();
-});
-const onSearch = () => {
-  state.currentPage = 1;
-  getGoodList();
-};
-// 获取商品列表
-const getGoodList = () => {
-  state.loading = true;
-  request
-    .get("/mallService/mechanism/staff/goods/list", {
-      params: {
-        page: state.currentPage,
-        pageSize: state.pageSize,
-        ...query,
-        goodsName: query.key
-      }
-    })
-    .then(res => {
-      state.tableData = res.data.list;
-      state.total = res.data.total;
-      state.loading = false;
-    });
-};
-const handleAdd = () => {
-  router.push({
-    path: "/myShop/goods/add"
-  });
-};
-const handleEdit = id => {
-  router.push({ path: "/myShop/goods/add", query: { id } });
-};
-const changePage = val => {
-  state.currentPage = val;
-  getGoodList();
-};
-
-const initCategory = () => {
-  return new Promise(resolve => {
-    request
-      .get("/mallService/mechanism/category", {
-        params: {
-          page: 1,
-          pageSize: 1000
-        }
-      })
-      .then(res => {
-        const list = res.data.list;
-        categoryList.value = list;
-        resolve();
-      });
-  });
-};
-const handleStatus = (id, status) => {
-  if (status == 1) {
-    ElMessageBox.confirm("确认下架该商品吗", "提示").then(() => {
-      request
-        .put(`/mallService/mechanism/goods/status/${status}`, {
-          ids: id ? [id] : []
-        })
-        .then(() => {
-          ElMessage.success("修改成功");
-          getGoodList();
-        });
-    });
-  } else {
-    request
-      .put(`/mallService/mechanism/goods/status/${status}`, {
-        ids: id ? [id] : []
-      })
-      .then(() => {
-        ElMessage.success("修改成功");
-        getGoodList();
-      });
-  }
-};
-
-const handleExamine = id => {
-  state.id = id;
-  state.visibleExamine = true;
-};
-
-const evaluationManageVisible = ref(false);
-const evaluationList = ref([]);
-const evaluationTotal = ref(0);
-
-const evaluationFilter = ref({
-  page: 1,
-  pageSize: 20,
-  goodsId: ""
-});
-const getEvaluationList = async id => {
-  evaluationFilter.value.goodsId = id;
-  const { data } = await request.get(
-    `/mallService/api/goods/appraise/paginate`,
-    {
-      params: evaluationFilter.value
-    }
-  );
-  evaluationList.value = data.list;
-
-  evaluationTotal.value = data.total;
-};
-const removeEvaluation = async item => {
-  await ElMessageBox.confirm("是否确认删除该评论?");
-
-  await request.post(`/mallService/mechanism/appraise/delete`, {
-    id: item.id
-  });
-  ElMessage.success("操作成功");
-  getEvaluationList(evaluationFilter.value.goodsId);
-};
-</script>
-
-<style scoped>
-.good-container {
-  min-height: 100%;
-}
-.el-card.is-always-shadow {
-  min-height: 100% !important;
-}
-</style>

+ 0 - 601
src/views/myShop/Order copy.vue

@@ -1,601 +0,0 @@
-<template>
-  <el-card class="order-container">
-    <template #header>
-      <div class="header flex items-center flex-wrap">
-        <el-input
-          style="width: 200px; margin-right: 10px"
-          placeholder="请输入订单号"
-          v-model="state.orderNo"
-          @change="handleOption"
-          clearable
-        />
-        <el-select
-          @change="handleOption"
-          v-model="state.orderStatus"
-          filterable
-          style="width: 200px; margin-right: 10px"
-        >
-          <el-option
-            v-for="item in state.options"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value"
-          />
-        </el-select>
-        <el-select
-          @change="handleOption"
-          v-model="state.tradeType"
-          filterable
-          style="width: 200px; margin-right: 10px"
-        >
-          <el-option label="全部交易方式" :value="-1" />
-          <el-option
-            v-for="item in tradeTypeList"
-            :key="item.v"
-            :label="item.k"
-            :value="item.v"
-          />
-        </el-select>
-        <el-select
-          @change="handleOption"
-          v-model="state.payType"
-          filterable
-          style="width: 200px; margin-right: 10px"
-        >
-          <el-option label="全部支付方式" :value="-1" />
-          <el-option
-            v-for="item in payTypeList"
-            :key="item.v"
-            :label="item.k"
-            :value="item.v"
-          />
-        </el-select>
-        <el-select
-          @change="handleOption"
-          v-model="state.shopId"
-          filterable
-          style="width: 200px; margin-right: 10px"
-        >
-          <el-option label="全部店铺" :value="-1" />
-          <el-option
-            v-for="item in state.shopList"
-            :key="item.id"
-            :label="item.name"
-            :value="item.id"
-          />
-        </el-select>
-
-        <!-- <el-button type="primary" size="small" icon="el-icon-edit">修改订单</el-button> -->
-        <!-- <el-button type="primary" :icon="HomeFilled" @click="handleConfig()"
-          >配货完成</el-button
-        >
-        <el-button type="primary" :icon="HomeFilled" @click="handleSend()"
-          >出库</el-button
-        > -->
-        <el-button type="danger" :icon="Delete" @click="handleClose()"
-          >关闭订单</el-button
-        >
-        <div class="flex justify-end flex-1 items-center">
-          <div
-            class="border border-solid border-gray-300 rounded p-2 cursor-pointer text-sm"
-            @click="complaintVisible = true"
-          >
-            <span>投诉信息:</span>
-            <span
-              class=" "
-              :class="
-                complaintWaitTotal ? 'text-red-600 font-bold' : 'text-green-600'
-              "
-              >{{ complaintWaitTotal }}条待处理</span
-            >
-          </div>
-          <el-button
-            class="ml-4"
-            :icon="Download"
-            type="success"
-            @click="state.visibleExportOrder = true"
-            >导出订单</el-button
-          >
-        </div>
-        <div></div>
-      </div>
-    </template>
-    <el-table
-      :data="state.tableData"
-      tooltip-effect="dark"
-      style="width: 100%"
-      @selection-change="handleSelectionChange"
-    >
-      <el-table-column type="selection" width="55"> </el-table-column>
-      <el-table-column prop="orderNo" label="订单号"> </el-table-column>
-      <!-- <el-table-column prop="orderNo" label="商品">
-        <template #default="{ row }">
-          <el-text tag="b">{{ row.goodsName }}</el-text>
-        </template>
-      </el-table-column>
-      <el-table-column prop="goodsCount" label="数量"> </el-table-column> -->
-
-      <el-table-column prop="totalPrice" label="订单总价">
-        <template #default="scope">
-          <span>{{ scope.row.totalPrice / 100 }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column prop="orderStatus" label="订单状态">
-        <template #default="scope">
-          <el-tag t type="success" v-if="scope.row.orderStatus == 4">{{
-            farmatOrderMap(scope.row.orderStatus)
-          }}</el-tag>
-          <span v-else>{{ farmatOrderMap(scope.row.orderStatus) }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="交易方式" prop="tradeType" width="">
-        <template #default="{ row }">
-          <el-text>{{ tradeTypeList[row.tradeType].k }}</el-text>
-        </template>
-      </el-table-column>
-
-      <el-table-column prop="payType" label="支付方式">
-        <template #default="scope">
-          <span v-if="scope.row.payType == 1">微信支付</span>
-          <span v-else-if="scope.row.payType == 2">支付宝支付</span>
-          <span v-else-if="9">其他</span>
-          <span v-else>系统</span>
-        </template>
-      </el-table-column>
-      <el-table-column prop="createTime" label="创建时间"> </el-table-column>
-      <el-table-column prop="updateTime" label="完成时间"> </el-table-column>
-      <el-table-column prop="targetName" label="补贴对象类别">
-        <template #default="{ row }">
-          {{ row.targetName || "无" }}
-        </template>
-      </el-table-column>
-      <el-table-column
-        label="所属店铺"
-        prop="shopName"
-        width=""
-      ></el-table-column>
-      <el-table-column label="操作" width="240">
-        <template #default="scope">
-          <el-popconfirm
-            v-if="scope.row.orderStatus == 1"
-            title="确定配货完成吗?"
-            @confirm="handleConfig(scope.row.orderId)"
-            confirm-button-text="确定"
-            cancel-button-text="取消"
-          >
-            <template #reference>
-              <a style="cursor: pointer; margin-right: 10px">配货完成</a>
-            </template>
-          </el-popconfirm>
-          <el-popconfirm
-            v-if="scope.row.orderStatus == 2"
-            title="确定出库吗?"
-            @confirm="handleSend(scope.row.orderId)"
-            confirm-button-text="确定"
-            cancel-button-text="取消"
-          >
-            <template #reference>
-              <a style="cursor: pointer; margin-right: 10px">出库</a>
-            </template>
-          </el-popconfirm>
-          <el-popconfirm
-            v-if="scope.row.orderStatus < 4"
-            title="确定关闭订单吗?"
-            @confirm="handleClose(scope.row.orderId)"
-            confirm-button-text="确定"
-            cancel-button-text="取消"
-          >
-            <template #reference>
-              <el-button type="primary" link style="margin-right: 10px"
-                >关闭订单</el-button
-              >
-            </template>
-          </el-popconfirm>
-          <router-link
-            :to="{
-              path: '/shop/order/detail',
-              query: { id: scope.row.orderNo }
-            }"
-          >
-            <el-link type="primary">订单详情</el-link>
-          </router-link>
-          &nbsp;&nbsp;
-          <!-- <el-popconfirm
-            v-if="scope.row.orderStatus < 4"
-            title="确定要完成订单吗?"
-            @confirm="handleCompleteOrder([scope.row.orderId])"
-            confirm-button-text="确定"
-            cancel-button-text="取消"
-          >
-            <template #reference>
-              <el-button type="primary" link :disabled="scope.row.orderStatus"
-                >完成订单</el-button
-              >
-            </template>
-          </el-popconfirm> -->
-          <el-button
-            type="primary"
-            v-if="scope.row.orderStatus < 4"
-            link
-            :disabled="scope.row.orderStatus"
-            @click="handleCompleteOrder(scope.row.orderId)"
-            >完成订单</el-button
-          >
-        </template>
-      </el-table-column>
-    </el-table>
-    <el-pagination
-      class="mt-4 justify-end"
-      background
-      layout="prev, pager, next"
-      :total="state.total"
-      :page-size="state.pageSize"
-      @current-change="changePage"
-    />
-    <el-dialog v-model="complaintVisible" title="投诉信息">
-      <div class="flex justify-between">
-        <el-button
-          type="primary"
-          plain
-          @click="
-            complaintFilter.page = 1;
-            getComplaintList();
-          "
-          >刷新</el-button
-        >
-        <el-select
-          v-model="complaintFilter.status"
-          @change="
-            complaintFilter.page = 1;
-            getComplaintList();
-          "
-        >
-          <el-option label="全部" :value="-1"></el-option>
-          <el-option
-            v-for="(item, index) in complaintStatusToText"
-            :key="index"
-            :label="item"
-            :value="index"
-          ></el-option>
-        </el-select>
-      </div>
-      <el-table :data="complaintList">
-        <el-table-column label="订单编号" prop="orderNo"></el-table-column>
-        <el-table-column label="投诉时间" prop="createAt"></el-table-column>
-        <el-table-column label="投诉处理状态">
-          <template #default="{ row }">
-            <span
-              :class="
-                [
-                  'text-orange-500',
-                  'text-blue-500',
-                  'text-red-500',
-                  'text-green-500'
-                ][row.status]
-              "
-              >{{ complaintStatusToText[row.status] }}</span
-            >
-          </template>
-        </el-table-column>
-        <el-table-column label="操作">
-          <template #default="{ row }">
-            <el-button
-              type="primary"
-              link
-              @click="
-                router.push({
-                  path: '/shop/order/detail',
-                  query: { id: row.orderNo }
-                })
-              "
-              >查看</el-button
-            >
-          </template>
-        </el-table-column>
-      </el-table>
-      <el-pagination
-        class="mt-4 justify-end"
-        background
-        layout="total, prev, pager, next"
-        :total="complaintTotal"
-        :page-size="complaintFilter.pageSize"
-        @current-change="
-          p => {
-            complaintFilter.page = p;
-            getComplaintList();
-          }
-        "
-      />
-    </el-dialog>
-
-    <DialogCompleteOreder
-      v-model:show="state.visibleCompleteOrder"
-      :orderId="state.orderId"
-      @success="getOrderList"
-    />
-    <DialogExportOrder
-      v-model:show="state.visibleExportOrder"
-      :orderId="state.orderId"
-      @success="getOrderList"
-    />
-  </el-card>
-</template>
-
-<script setup>
-import { onMounted, reactive, ref } from "vue";
-import { ElMessage } from "element-plus";
-import { HomeFilled, Delete, Download } from "@element-plus/icons-vue";
-import { request } from "@/utils";
-import DialogCompleteOreder from "./components/DialogCompleteOreder.vue";
-import DialogExportOrder from "./components/DialogExportOrder.vue";
-
-import { useRouter } from "vue-router";
-const router = useRouter();
-const state = reactive({
-  loading: false,
-  tableData: [], // 数据列表
-  multipleSelection: [], // 选中项
-  total: 0, // 总条数
-  currentPage: 1, // 当前页
-  pageSize: 10, // 分页大小
-  orderNo: "", // 订单号
-  orderStatus: -1, // 订单状态
-  tradeType: -1, // 交易方式
-  shopList: [],
-  shopId: -1,
-  payType: -1,
-  visibleCompleteOrder: false,
-  visibleExportOrder: false,
-  orderId: undefined,
-  // 订单状态筛选项默认值
-  options: [
-    {
-      value: -1,
-      label: "全部"
-    },
-    {
-      value: 0,
-      label: "待支付"
-    },
-    {
-      value: 1,
-      label: "已支付"
-    },
-    // {
-    //   value: 2,
-    //   label: "配货完成"
-    // },
-    {
-      value: 3,
-      label: "已发货"
-    },
-    {
-      value: 4,
-      label: "交易成功"
-    },
-    {
-      value: 5,
-      label: "用户关闭"
-    },
-    {
-      value: 6,
-      label: "超时关闭"
-    },
-    {
-      value: 7,
-      label: "商家关闭"
-    }
-  ]
-});
-const tradeTypeList = [
-  {
-    k: "线下",
-    v: 0
-  },
-  {
-    k: "线上",
-    v: 1
-  }
-];
-const payTypeList = {
-  1: {
-    k: "支付宝支付",
-    v: 1
-  },
-  2: {
-    k: "微信支付",
-    v: 2
-  },
-  9: {
-    k: "其他",
-    v: 9
-  }
-};
-const orderStatus = {
-  0: "待支付",
-  1: "已支付",
-  3: "出库成功",
-  4: "交易成功",
-  5: "用户关闭",
-  6: "超时关闭",
-  7: "商家关闭"
-};
-// 初始化获取订单列表
-onMounted(() => {
-  getOrderList();
-  getShopList();
-});
-
-const farmatOrderMap = status => {
-  return orderStatus[status] || "未知状态";
-};
-
-const getShopList = () => {
-  request
-    .get("/articleService/serviceProvider/shop/paginate", {
-      params: {
-        page: 1,
-        pageSize: 9999,
-        type: -1,
-        status: -1
-      }
-    })
-    .then(resp => {
-      state.shopList = resp.data.list;
-    });
-};
-
-// 获取列表方法
-const getOrderList = () => {
-  state.loading = true;
-  request
-    .get("/mallService/mechanism/orders", {
-      params: {
-        page: state.currentPage,
-        pageSize: state.pageSize,
-        orderNo: state.orderNo,
-        orderStatus: state.orderStatus,
-        tradeType: state.tradeType,
-        shopId: state.shopId,
-        payType: state.payType
-      }
-    })
-    .then(res => {
-      state.tableData = res.data.list;
-      state.total = res.data.total;
-    });
-};
-// 触发过滤项方法
-const handleOption = () => {
-  state.currentPage = 1;
-  getOrderList();
-};
-// checkbox 选择项
-const handleSelectionChange = val => {
-  state.multipleSelection = val;
-};
-// 翻页方法
-const changePage = val => {
-  state.currentPage = val;
-  getOrderList();
-};
-// 完成订单
-const handleCompleteOrder = id => {
-  state.orderId = id;
-  state.visibleCompleteOrder = true;
-  // request
-  //   .put("/mallService/mechanism/orders/complete", {
-  //     ids
-  //   })
-  //   .then(resp => {
-  //     ElMessage.success(resp.message);
-  //     getOrderList();
-  //   });
-};
-// 配货方法
-const handleConfig = id => {
-  let params;
-  // 当个配置
-  if (id) {
-    params = [id];
-  } else {
-    if (!state.multipleSelection.length) {
-      console.log("state.multipleSelection", state.multipleSelection.length);
-      ElMessage.error("请选择项");
-      return;
-    }
-    // 多选配置
-    params = state.multipleSelection.map(i => i.orderId);
-  }
-  request
-    .put("/mallService/mechanism/orders/checkDone", {
-      ids: params
-    })
-    .then(() => {
-      ElMessage.success("配货成功");
-      getOrderList();
-    });
-};
-// 出库方法
-const handleSend = id => {
-  let params;
-  if (id) {
-    params = [id];
-  } else {
-    if (!state.multipleSelection.length) {
-      ElMessage.error("请选择项");
-      return;
-    }
-    params = state.multipleSelection.map(i => i.orderId);
-  }
-  request
-    .put("/mallService/mechanism/orders/checkOut", {
-      ids: params
-    })
-    .then(() => {
-      ElMessage.success("出库成功");
-      getOrderList();
-    });
-};
-// 关闭订单方法
-const handleClose = id => {
-  let params;
-  if (id) {
-    params = [id];
-  } else {
-    if (!state.multipleSelection.length) {
-      ElMessage.error("请选择项");
-      return;
-    }
-    params = state.multipleSelection.map(i => i.orderId);
-  }
-  request
-    .put("/mallService/mechanism/orders/close", {
-      ids: params
-    })
-    .then(() => {
-      ElMessage.success("关闭成功");
-      getOrderList();
-    });
-};
-const complaintStatusToText = {
-  0: "待商家处理",
-  1: "商家已处理",
-  2: "待平台处理",
-  3: "平台已处理"
-};
-const complaintVisible = ref(false);
-const complaintList = ref([]);
-const complaintWaitTotal = ref(0);
-const complaintTotal = ref(0);
-const complaintFilter = ref({
-  page: 1,
-  pageSize: 15,
-  status: -1
-});
-const getComplaintWaitTotal = async () => {
-  const { data } = await request.get(
-    `/mallService/mechanism/complaint/paginate`,
-    {
-      params: {
-        page: 1,
-        status: 2,
-        pageSize: 0
-      }
-    }
-  );
-  complaintWaitTotal.value = data.total;
-};
-const getComplaintList = async () => {
-  const { data } = await request.get(
-    `/mallService/mechanism/complaint/paginate`,
-    {
-      params: complaintFilter.value
-    }
-  );
-  complaintList.value = data.list;
-  complaintTotal.value = data.total;
-};
-getComplaintWaitTotal();
-getComplaintList();
-</script>

+ 0 - 600
src/views/myShop/Order.vue

@@ -1,600 +0,0 @@
-<template>
-  <el-card class="order-container">
-    <template #header>
-      <div class="header flex items-center flex-wrap">
-        <el-input
-          style="width: 200px; margin-right: 10px"
-          placeholder="请输入订单号"
-          v-model="state.orderNo"
-          @change="handleOption"
-          clearable
-        />
-        <el-select
-          @change="handleOption"
-          v-model="state.orderStatus"
-          filterable
-          style="width: 200px; margin-right: 10px"
-        >
-          <el-option
-            v-for="item in state.options"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value"
-          />
-        </el-select>
-        <el-select
-          @change="handleOption"
-          v-model="state.tradeType"
-          filterable
-          style="width: 200px; margin-right: 10px"
-        >
-          <el-option label="全部交易方式" :value="-1" />
-          <el-option
-            v-for="item in tradeTypeList"
-            :key="item.v"
-            :label="item.k"
-            :value="item.v"
-          />
-        </el-select>
-        <el-select
-          @change="handleOption"
-          v-model="state.payType"
-          filterable
-          style="width: 200px; margin-right: 10px"
-        >
-          <el-option label="全部支付方式" :value="-1" />
-          <el-option
-            v-for="item in payTypeList"
-            :key="item.v"
-            :label="item.k"
-            :value="item.v"
-          />
-        </el-select>
-        <!-- <el-select
-          @change="handleOption"
-          v-model="state.shopId"
-          filterable
-          style="width: 200px; margin-right: 10px"
-        >
-          <el-option label="全部店铺" :value="-1" />
-          <el-option
-            v-for="item in state.shopList"
-            :key="item.id"
-            :label="item.name"
-            :value="item.id"
-          />
-        </el-select> -->
-
-        <!-- <el-button type="primary" size="small" icon="el-icon-edit">修改订单</el-button> -->
-        <!-- <el-button type="primary" :icon="HomeFilled" @click="handleConfig()"
-          >配货完成</el-button
-        >
-        <el-button type="primary" :icon="HomeFilled" @click="handleSend()"
-          >出库</el-button
-        > -->
-        <el-button type="danger" :icon="Delete" @click="handleClose()"
-          >关闭订单</el-button
-        >
-        <!-- <div class="flex justify-end flex-1">
-          <div class="border border-solid border-gray-300 rounded p-2 cursor-pointer text-sm" @click="complaintVisible = true">
-            <span>投诉信息:</span>
-            <span class=" " :class="complaintWaitTotal ? 'text-red-600 font-bold' : 'text-green-600'">{{ complaintWaitTotal }}条待处理</span>
-          </div>
-        </div> -->
-        <el-button
-          class="ml-4"
-          :icon="Download"
-          type="success"
-          @click="state.visibleExportOrder = true"
-          >导出订单</el-button
-        >
-      </div>
-    </template>
-    <el-table
-      :data="state.tableData"
-      tooltip-effect="dark"
-      style="width: 100%"
-      @selection-change="handleSelectionChange"
-    >
-      <el-table-column type="selection" width="55"> </el-table-column>
-      <el-table-column prop="orderNo" label="订单号"> </el-table-column>
-      <!-- <el-table-column prop="orderNo" label="商品">
-        <template #default="{ row }">
-          <el-text tag="b">{{ row.goodsName }}</el-text>
-        </template>
-      </el-table-column>
-      <el-table-column prop="goodsCount" label="数量"> </el-table-column> -->
-
-      <el-table-column prop="totalPrice" label="订单总价">
-        <template #default="scope">
-          <span>{{ scope.row.totalPrice / 100 }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column prop="orderStatus" label="订单状态">
-        <template #default="scope">
-          <el-tag t type="success" v-if="scope.row.orderStatus == 4">{{
-            farmatOrderMap(scope.row.orderStatus)
-          }}</el-tag>
-          <span v-else>{{ farmatOrderMap(scope.row.orderStatus) }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="交易方式" prop="tradeType" width="">
-        <template #default="{ row }">
-          <el-text>{{ tradeTypeList[row.tradeType].k }}</el-text>
-        </template>
-      </el-table-column>
-
-      <el-table-column prop="payType" label="支付方式">
-        <template #default="scope">
-          <span v-if="scope.row.payType == 1">微信支付</span>
-          <span v-else-if="scope.row.payType == 2">支付宝支付</span>
-          <span v-else-if="9">其他</span>
-          <span v-else>系统</span>
-        </template>
-      </el-table-column>
-      <el-table-column prop="createTime" label="创建时间"> </el-table-column>
-      <el-table-column prop="updateTime" label="完成时间"> </el-table-column>
-      <el-table-column prop="targetName" label="补贴对象">
-        <template #default="{ row }">
-          {{ row.targetName || "-" }}
-        </template>
-      </el-table-column>
-
-      <el-table-column
-        label="所属店铺"
-        prop="shopName"
-        width=""
-      ></el-table-column>
-      <el-table-column label="操作" width="240">
-        <template #default="scope">
-          <div class="">
-            <el-popconfirm
-              v-if="scope.row.orderStatus < 4"
-              title="确定关闭订单吗?"
-              @confirm="handleClose(scope.row.orderId)"
-              confirm-button-text="确定"
-              cancel-button-text="取消"
-            >
-              <template #reference>
-                <el-button type="primary" link style="margin-right: 10px"
-                  >关闭订单</el-button
-                >
-              </template>
-            </el-popconfirm>
-            <router-link
-              :to="{
-                path: '/myShop/order/detail',
-                query: { id: scope.row.orderNo }
-              }"
-            >
-              <el-button type="primary" link>订单详情</el-button>
-            </router-link>
-            <!-- <el-button
-              type="primary"
-              v-if="scope.row.orderStatus < 4"
-              link
-              style="margin-left: 10px"
-              @click="
-                () => {
-                  rowData = scope.row;
-                  remarkVisible = true;
-                }
-              "
-              >完成订单</el-button
-            > -->
-            <el-button
-              type="primary"
-              v-if="scope.row.orderStatus < 4"
-              link
-              :disabled="scope.row.orderStatus"
-              @click="handleCompleteOrder(scope.row.orderId)"
-              >完成订单</el-button
-            >
-          </div>
-          <!-- <el-popconfirm
-            v-if="scope.row.orderStatus < 4"
-            title="确定要完成订单吗?"
-            @confirm="handleCompleteOrder([scope.row.orderId])"
-            confirm-button-text="确定"
-            cancel-button-text="取消"
-          >
-            <template #reference>
-              <el-button type="primary" link :disabled="scope.row.orderStatus"
-                >完成订单</el-button
-              >
-            </template>
-          </el-popconfirm> -->
-        </template>
-      </el-table-column>
-    </el-table>
-    <el-pagination
-      class="mt-4 justify-end"
-      background
-      layout="prev, pager, next"
-      :total="state.total"
-      :page-size="state.pageSize"
-      @current-change="changePage"
-    />
-    <el-dialog v-model="complaintVisible" title="投诉信息">
-      <div class="flex justify-between">
-        <el-button
-          type="primary"
-          plain
-          @click="
-            complaintFilter.page = 1;
-            getComplaintList();
-          "
-          >刷新</el-button
-        >
-        <el-select
-          v-model="complaintFilter.status"
-          @change="
-            complaintFilter.page = 1;
-            getComplaintList();
-          "
-        >
-          <el-option label="全部" :value="-1"></el-option>
-          <el-option
-            v-for="(item, index) in complaintStatusToText"
-            :key="index"
-            :label="item"
-            :value="index"
-          ></el-option>
-        </el-select>
-      </div>
-      <el-table :data="complaintList">
-        <el-table-column label="订单编号" prop="orderNo"></el-table-column>
-        <el-table-column label="投诉时间" prop="createAt"></el-table-column>
-        <el-table-column label="投诉处理状态">
-          <template #default="{ row }">
-            <span
-              :class="
-                [
-                  'text-orange-500',
-                  'text-blue-500',
-                  'text-red-500',
-                  'text-green-500'
-                ][row.status]
-              "
-              >{{ complaintStatusToText[row.status] }}</span
-            >
-          </template>
-        </el-table-column>
-        <el-table-column label="操作">
-          <template #default="{ row }">
-            <el-button
-              type="primary"
-              link
-              @click="
-                router.push({
-                  path: '/myShop/order/detail',
-                  query: { id: row.orderNo }
-                })
-              "
-              >查看</el-button
-            >
-          </template>
-        </el-table-column>
-      </el-table>
-      <el-pagination
-        class="mt-4 justify-end"
-        background
-        layout="total, prev, pager, next"
-        :total="complaintTotal"
-        :page-size="complaintFilter.pageSize"
-        @current-change="
-          p => {
-            complaintFilter.page = p;
-            getComplaintList();
-          }
-        "
-      />
-    </el-dialog>
-    <el-dialog v-model="remarkVisible">
-      <TradNote
-        :id="rowData.orderNo"
-        @onSave="handleCompleteOrder"
-        @title="备注信息;"
-      />
-    </el-dialog>
-    <DialogCompleteOreder
-      v-model:show="state.visibleCompleteOrder"
-      :orderId="state.orderId"
-      @success="getOrderList"
-    />
-    <DialogExportOrder
-      v-model:show="state.visibleExportOrder"
-      :orderId="state.orderId"
-      @success="getOrderList"
-    />
-  </el-card>
-</template>
-
-<script setup>
-import { onMounted, reactive, ref } from "vue";
-import { ElMessage } from "element-plus";
-import { HomeFilled, Delete, Download } from "@element-plus/icons-vue";
-import { request } from "@/utils";
-
-import DialogCompleteOreder from "./components/DialogCompleteOreder.vue";
-import DialogExportOrder from "./components/DialogExportOrder.vue";
-
-import { useRouter } from "vue-router";
-import TradNote from "./components/TradNote.vue";
-
-const router = useRouter();
-const rowData = ref({
-  orderNo: ""
-});
-const state = reactive({
-  loading: false,
-  tableData: [], // 数据列表
-  multipleSelection: [], // 选中项
-  total: 0, // 总条数
-  currentPage: 1, // 当前页
-  pageSize: 10, // 分页大小
-  orderNo: "", // 订单号
-  orderStatus: -1, // 订单状态
-  tradeType: -1, // 交易方式
-  shopList: [],
-  shopId: -1,
-  payType: -1,
-  visibleCompleteOrder: false,
-  visibleExportOrder: false,
-  orderId: undefined,
-  // 订单状态筛选项默认值
-  options: [
-    {
-      value: -1,
-      label: "全部"
-    },
-    {
-      value: 0,
-      label: "待支付"
-    },
-    {
-      value: 1,
-      label: "已支付"
-    },
-    // {
-    //   value: 2,
-    //   label: "配货完成"
-    // },
-    {
-      value: 3,
-      label: "已发货"
-    },
-    {
-      value: 4,
-      label: "交易成功"
-    },
-    {
-      value: 5,
-      label: "用户关闭"
-    },
-    {
-      value: 6,
-      label: "超时关闭"
-    },
-    {
-      value: 7,
-      label: "商家关闭"
-    }
-  ]
-});
-const tradeTypeList = [
-  {
-    k: "线下",
-    v: 0
-  },
-  {
-    k: "线上",
-    v: 1
-  }
-];
-const payTypeList = {
-  1: {
-    k: "支付宝支付",
-    v: 1
-  },
-  2: {
-    k: "微信支付",
-    v: 2
-  },
-  9: {
-    k: "其他",
-    v: 9
-  }
-};
-const orderStatus = {
-  0: "待支付",
-  1: "已支付",
-  3: "出库成功",
-  4: "交易成功",
-  5: "用户关闭",
-  6: "超时关闭",
-  7: "商家关闭"
-};
-// 初始化获取订单列表
-onMounted(() => {
-  getOrderList();
-  // getShopList();
-});
-
-const farmatOrderMap = status => {
-  return orderStatus[status] || "未知状态";
-};
-
-const getShopList = () => {
-  request
-    .get("/articleService/serviceProvider/shop/paginate", {
-      params: {
-        page: 1,
-        pageSize: 9999,
-        type: -1,
-        status: -1
-      }
-    })
-    .then(resp => {
-      state.shopList = resp.data.list;
-    });
-};
-
-// 获取列表方法
-const getOrderList = () => {
-  state.loading = true;
-  request
-    .get("/mallService/mechanism/staff/orders", {
-      params: {
-        page: state.currentPage,
-        pageSize: state.pageSize,
-        orderNo: state.orderNo,
-        orderStatus: state.orderStatus,
-        tradeType: state.tradeType,
-        shopId: state.shopId,
-        payType: state.payType
-      }
-    })
-    .then(res => {
-      state.tableData = res.data.list;
-      state.total = res.data.total;
-    });
-};
-// 触发过滤项方法
-const handleOption = () => {
-  state.currentPage = 1;
-  getOrderList();
-};
-// checkbox 选择项
-const handleSelectionChange = val => {
-  state.multipleSelection = val;
-};
-// 翻页方法
-const changePage = val => {
-  state.currentPage = val;
-  getOrderList();
-};
-// 完成订单
-const handleCompleteOrder = () => {
-  state.orderId = id;
-  state.visibleCompleteOrder = true;
-  // request
-  //   .put("/mallService/mechanism/orders/complete", {
-  //     ids: [rowData.value.orderId]
-  //   })
-  //   .then(resp => {
-  //     ElMessage.success(resp.message);
-  //     getOrderList();
-  //     remarkVisible.value = false;
-  //   });
-};
-// 配货方法
-const handleConfig = id => {
-  let params;
-  // 当个配置
-  if (id) {
-    params = [id];
-  } else {
-    if (!state.multipleSelection.length) {
-      console.log("state.multipleSelection", state.multipleSelection.length);
-      ElMessage.error("请选择项");
-      return;
-    }
-    // 多选配置
-    params = state.multipleSelection.map(i => i.orderId);
-  }
-  request
-    .put("/mallService/mechanism/orders/checkDone", {
-      ids: params
-    })
-    .then(() => {
-      ElMessage.success("配货成功");
-      getOrderList();
-    });
-};
-// 出库方法
-const handleSend = id => {
-  let params;
-  if (id) {
-    params = [id];
-  } else {
-    if (!state.multipleSelection.length) {
-      ElMessage.error("请选择项");
-      return;
-    }
-    params = state.multipleSelection.map(i => i.orderId);
-  }
-  request
-    .put("/mallService/mechanism/orders/checkOut", {
-      ids: params
-    })
-    .then(() => {
-      ElMessage.success("出库成功");
-      getOrderList();
-    });
-};
-// 关闭订单方法
-const handleClose = id => {
-  let params;
-  if (id) {
-    params = [id];
-  } else {
-    if (!state.multipleSelection.length) {
-      ElMessage.error("请选择项");
-      return;
-    }
-    params = state.multipleSelection.map(i => i.orderId);
-  }
-  request
-    .put("/mallService/mechanism/orders/close", {
-      ids: params
-    })
-    .then(() => {
-      ElMessage.success("关闭成功");
-      getOrderList();
-    });
-};
-const remarkVisible = ref(false);
-const complaintStatusToText = {
-  0: "待商家处理",
-  1: "商家已处理",
-  2: "待平台处理",
-  3: "平台已处理"
-};
-const complaintVisible = ref(false);
-const complaintList = ref([]);
-const complaintWaitTotal = ref(0);
-const complaintTotal = ref(0);
-const complaintFilter = ref({
-  page: 1,
-  pageSize: 15,
-  status: -1,
-  isShop: 1
-});
-const getComplaintWaitTotal = async () => {
-  const { data } = await request.get(
-    `/mallService/mechanism/complaint/paginate`,
-    {
-      params: {
-        page: 1,
-        status: 2,
-        pageSize: 0,
-        isShop: 1
-      }
-    }
-  );
-  complaintWaitTotal.value = data.total;
-};
-const getComplaintList = async () => {
-  const { data } = await request.get(
-    `/mallService/mechanism/complaint/paginate`,
-    {
-      params: complaintFilter.value
-    }
-  );
-  complaintList.value = data.list;
-  complaintTotal.value = data.total;
-};
-getComplaintWaitTotal();
-getComplaintList();
-</script>

+ 0 - 503
src/views/myShop/OrderDetail.vue

@@ -1,503 +0,0 @@
-<template>
-  <div>
-    <el-card class="order-container">
-      <div class="data">
-        <el-card class="data-item" shadow="hover">
-          <template #header>
-            <div class="card-header">
-              <span>订单状态</span>
-            </div>
-          </template>
-          <div class="text-left">
-            <el-text>创建时间:{{ state.data.createTime }} </el-text><br />
-            <el-text
-              >交易方式:{{ state.data.tradeType ? "线上" : "线下" }}
-            </el-text>
-            <br />
-            <el-text>订单号:{{ state.data.orderNo }} </el-text><br />
-            <el-text>订单状态:{{ state.data.orderStatusString }} </el-text
-            ><br />
-            <el-text>订单金额:¥{{ state.data.totalPrice / 100 }} </el-text
-            ><br />
-            <el-text>完成时间:{{ state.data.updateTime }} </el-text><br />
-          </div>
-        </el-card>
-        <el-card class="data-item" shadow="hover">
-          <template #header>
-            <div class="card-header">
-              <span>收货人信息</span>
-            </div>
-          </template>
-          <div v-if="state.data?.orderAddress?.userName">
-            <el-text>姓名:{{ state.data.orderAddress?.userName }}</el-text
-            ><br />
-            <el-text>电话:{{ state.data.orderAddress?.userPhone }}</el-text>
-            <br />
-            <el-text
-              >地址:
-              {{
-                state.data.orderAddress.provinceName +
-                state.data.orderAddress.cityName +
-                state.data.orderAddress.regionName +
-                state.data.orderAddress.detailAddress
-              }}
-            </el-text>
-          </div>
-          <div v-else>暂无地址</div>
-        </el-card>
-        <el-card class="data-item" shadow="hover">
-          <template #header>
-            <div class="card-header flex items-center justify-between">
-              <span>交易双方信息</span>
-              <el-button
-                v-if="complaint?.id"
-                type="danger"
-                link
-                @click="complaintInfoVisible = true"
-                >投诉信息 ></el-button
-              >
-            </div>
-          </template>
-          <div>
-            <el-text>订单所属店铺:{{ state.data.shopName }}</el-text> <br />
-            <el-text>店铺ID: {{ state.data.shopIds }}</el-text> <br />
-            <el-text>店铺负责人电话: {{ state.data.principal }}</el-text> <br />
-
-            <el-text>购买人ID: {{ state.data.userId }}</el-text> <br />
-            <el-text>购买人昵称: {{ state.data?.userNickname || "-" }}</el-text
-            ><br />
-            <el-text>购买人电话: {{ state.data.userMobile }}</el-text> <br />
-
-            <br />
-          </div>
-        </el-card>
-      </div>
-      <el-table
-        :data="state.tableData"
-        tooltip-effect="dark"
-        style="width: 100%"
-      >
-        <el-table-column label="商品图片">
-          <template #default="scope">
-            <img
-              style="width: 100px"
-              :key="scope.row.goodsId"
-              :src="scope.row.goodsCoverImg"
-              alt="商品主图"
-            />
-          </template>
-        </el-table-column>
-        <el-table-column prop="goodsId" label="商品编号"> </el-table-column>
-        <el-table-column prop="goodsName" label="商品名"></el-table-column>
-        <el-table-column prop="goodsCount" label="商品数量"> </el-table-column>
-        <el-table-column prop="sellingPrice" label="单价">
-          <template #default="{ row }">
-            {{ row.sellingPrice / 100 }}
-          </template>
-        </el-table-column>
-      </el-table>
-    </el-card>
-
-    <el-card
-      title="交易备注"
-      v-if="[4, 7].includes(state.data.orderStatus)"
-      class="mt-6"
-    >
-      <template #header>
-        <div class="flex justify-between">
-          <span>交易备注</span>
-          <el-button plain @click="onSaveComment">修改交易备注</el-button>
-        </div>
-      </template>
-      <div>
-        <div v-if="state.data.subsidyTargetId" class="mb-2">
-          <div class="text-base">
-            选择该笔订单民政补贴对象类别:
-            <el-text tag="b" class="text-base"
-              ><em>{{ subsidyTargeStr }}</em></el-text
-            >
-          </div>
-          <div>
-            <el-text class="text-base text-red-500">{{
-              state.subsidyDetail.comment
-            }}</el-text>
-          </div>
-        </div>
-        <div>
-          <div>交易成功备注:{{ state.data.comment }}</div>
-          <div class="my-2">交易凭证照片:</div>
-          <el-image
-            v-for="item in state.images"
-            :key="item.uid"
-            style="width: 120px; height: 120px"
-            class="mr-2 rounded"
-            :src="item.url"
-            :preview-src-list="state.images?.map(v => v.url)"
-          ></el-image>
-        </div>
-        <!-- <el-input
-          v-model="state.data.comment"
-          type="textarea"
-          :rows="5"
-          placeholder="请输入交易备注"
-          clearable
-        />
-        <div class="mt-4">
-          <div class="mb-4">上传交易图片</div>
-          <UploadOnlyImage
-            v-model:url="state.images"
-            :key="coverKey"
-            type="image"
-          />
-        </div> -->
-      </div>
-    </el-card>
-    <el-dialog
-      v-model="complaintInfoVisible"
-      title="投诉信息"
-      @close="audioPause"
-    >
-      <el-form label>
-        <el-form-item label="投诉内容">
-          <div>{{ complaint.complaint }}</div>
-        </el-form-item>
-        <el-form-item v-if="complaint.voice" label="语音信息">
-          <div class="flex">
-            <div
-              class="flex items-center border-0 bg-green-400 rounded-lg text-gray-700 text-sm w-fit py-2 px-4 cursor-pointer"
-              @click="toggleComplaintPlay"
-            >
-              <div class="transform-gpu">
-                <Microphone class="w-4 h-4" />
-              </div>
-              <span class="ml-2"
-                >{{
-                  complaintVoice.isPlaying
-                    ? `${complaintVoice.currentTime}"`
-                    : `${complaintVoice.duration || complaint.duration}"`
-                }}
-              </span>
-            </div>
-          </div>
-        </el-form-item>
-        <el-form-item label="投诉时间">
-          <div>{{ complaint.createAt }}</div>
-        </el-form-item>
-      </el-form>
-      <div
-        class="m-4 shadow border border-solid border-gray-100 p-4"
-        v-if="complaint.shopComment"
-      >
-        <div
-          class="flex items-center justify-between border-b border-solid border-gray-200"
-        >
-          <h2 class="font-bold text-base mb-2">商家处理信息</h2>
-          <span class="text-sm text-gray-500"
-            >{{ complaint.shopUpdateAt }}完成</span
-          >
-        </div>
-        <div class="text-sm text-gray-700 whitespace-pre-wrap my-4">
-          {{ complaint.shopComment }}
-        </div>
-        <div>
-          <el-image
-            v-for="(item, index) in complaint.shopImages"
-            :initial-index="index"
-            class="w-20 h-20 mb-2 mr-2 rounded"
-            :key="index"
-            :src="item"
-            fit="cover"
-            :preview-src-list="complaint.showImages"
-          ></el-image>
-        </div>
-      </div>
-      <div
-        class="m-4 shadow border border-solid border-gray-100 p-4"
-        v-if="complaint.mechanismComment"
-      >
-        <div
-          class="flex items-center justify-between border-b border-solid border-gray-200"
-        >
-          <h2 class="font-bold text-base mb-2">平台处理信息</h2>
-          <span class="text-sm text-gray-500"
-            >{{ complaint.mechanismUpdateAt }}完成</span
-          >
-        </div>
-        <div class="text-sm text-gray-700 whitespace-pre-wrap my-4">
-          {{ complaint.mechanismComment }}
-        </div>
-        <div>
-          <el-image
-            v-for="(item, index) in complaint.mechanismImages"
-            :initial-index="index"
-            :key="index"
-            :src="item"
-            fit="cover"
-            class="w-20 h-20 mb-2 mr-2 rounded"
-            :preview-src-list="complaint.mechanismImages"
-          ></el-image>
-        </div>
-      </div>
-      <template #footer>
-        <!-- <el-popconfirm
-          title="确认要删除这个投诉吗?删除后不可恢复"
-          width="240"
-          icon="delete"
-          @confirm="deleteComplaint"
-        >
-          <template #reference>
-            <el-button type="danger" plain>删除</el-button>
-          </template>
-        </el-popconfirm> -->
-        <template v-if="complaint.status == 0">
-          <!-- <el-popconfirm
-            title="确认该投诉已处理完成了吗?确定后,该状态不可更改"
-            width="240"
-            @confirm="completeComplaint"
-          >
-            <template #reference>
-            </template>
-            </el-popconfirm> -->
-          <el-button type="primary" @click="openCompleteComplaint"
-            >标记为已处理</el-button
-          >
-        </template>
-      </template>
-    </el-dialog>
-    <el-dialog v-model="completeComplaintVisible" title="标记为已处理">
-      <el-form label-position="top">
-        <el-form-item required label="填写处理备注">
-          <el-input
-            v-model="completeComplaintDetail.comment"
-            type="textarea"
-            placeholder="请填写处理备注"
-          ></el-input>
-        </el-form-item>
-        <el-form-item required label="上传处理图片凭证">
-          <UploadOnlyImage
-            v-model:url="completeComplaintDetail.images"
-            :key="Date.now()"
-            type="image"
-          />
-        </el-form-item>
-      </el-form>
-      <template #footer>
-        <el-button type="primary" @click="completeComplaint">确定</el-button>
-      </template>
-    </el-dialog>
-    <audio
-      ref="audioRef"
-      @pause="onPause"
-      @play="onPlay"
-      @timeupdate="onTimeupdate"
-      @canplay="onLoadedmetadata"
-      :src="complaint.voice"
-      controls="controls"
-      type="audio/mpeg"
-      class="hidden"
-    ></audio>
-
-    <DialogCompleteOreder
-      v-model:show="state.visibleEditRemark"
-      :orderId="state.data.orderId"
-      :rowData="{
-        subsidyTargetId: state.data?.subsidyTargetId,
-        comment: state.data.comment,
-        images: state.images
-      }"
-      @success="getOrderDetail"
-      type="edit"
-    ></DialogCompleteOreder>
-  </div>
-</template>
-
-<script setup>
-import { onMounted, reactive, ref } from "vue";
-import { useRoute } from "vue-router";
-import { request } from "@/utils/index";
-import UploadImage from "@/components/UploadImage.vue";
-import UploadOnlyImage from "@/components/UploadOnlyImage.vue";
-import { ElMessage } from "element-plus";
-import {
-  Microphone,
-  ArrowUp,
-  ArrowDown,
-  Delete,
-  QuestionFilled
-} from "@element-plus/icons-vue";
-const route = useRoute();
-const { id } = route.query;
-const state = reactive({
-  data: {},
-  tableData: [],
-  images: [],
-  subsidyDetail: {},
-  visibleEditRemark: false
-});
-
-const subsidyTargeStr = computed(() => {
-  if (!state.data?.subsidyTargetId) return;
-  return state.subsidyDetail?.targets?.find(
-    v => v.id == state.data.subsidyTargetId
-  ).name;
-});
-
-const coverKey = ref(Date.now());
-
-const onSaveComment = () => {
-  if (!state.data.comment) {
-    return ElMessage.error("请输入备注");
-  }
-  if (state.images?.length < 3) {
-    return ElMessage.error("至少上传3张交易图片");
-  }
-  request
-    .put("/mallService/mechanism/orders/comment", {
-      ids: [state.data.orderId],
-      comment: state.data.comment,
-      images: state.images.map(v => v.url)
-    })
-    .then(resp => {
-      ElMessage.success(resp.message);
-      getOrderDetail();
-    });
-};
-const getOrderDetail = () => {
-  request.get(`/mallService/mechanism/orders/${id}`).then(res => {
-    state.data = res.data;
-    state.images = res.data.images?.map((v, i) => {
-      return {
-        url: v,
-        name: "images" + i,
-        status: "success",
-        uid: new Date().getTime()
-      };
-    });
-    if (!state.images) {
-      state.images = [];
-    }
-    state.tableData = res.data.orderItems;
-    getSubsidyDetail();
-  });
-};
-onMounted(() => {
-  getOrderDetail();
-  getComplaint();
-});
-
-const complaintInfoVisible = ref(false);
-const complaint = ref({
-  id: "",
-  voice: "",
-  complaint: "",
-  status: 0,
-  duration: 0
-});
-const complaintVoice = ref({
-  isPlaying: false,
-  currentTime: 0,
-  duration: 0
-});
-const audioRef = ref();
-const getComplaint = async () => {
-  const { data } = await request.get(`/mallService/mechanism/order/complaint`, {
-    params: {
-      orderNo: route.query.id
-    }
-  });
-  complaint.value = data || { id: "", voice: "", complaint: "", duration: 0 };
-  audioPause();
-};
-const toggleComplaintPlay = async () => {
-  complaintVoice.value.isPlaying ? audioPause() : audioPlay();
-};
-const onTimeupdate = res => {
-  complaintVoice.value.currentTime = Math.floor(res.target.currentTime);
-};
-const onLoadedmetadata = res => {
-  complaintVoice.value.duration = parseInt(res.target.duration);
-};
-
-const audioPlay = () => {
-  audioRef.value.play();
-};
-const audioPause = () => {
-  audioRef.value.pause();
-};
-const onPlay = () => {
-  complaintVoice.value.isPlaying = true;
-};
-const onPause = () => {
-  complaintVoice.value.isPlaying = false;
-};
-const deleteComplaint = async () => {
-  await request.post(`/mallService/mechanism/complaint/delete`, {
-    id: complaint.value.id
-  });
-  ElMessage.success("操作成功");
-  complaintInfoVisible.value = false;
-  getComplaint();
-};
-const completeComplaintVisible = ref(false);
-const completeComplaintDetail = ref({
-  comment: "",
-  images: []
-});
-const openCompleteComplaint = () => {
-  completeComplaintVisible.value = true;
-};
-const completeComplaint = async () => {
-  if (!completeComplaintDetail.value.comment) {
-    return ElMessage.error("请填写处理备注");
-  }
-  if (completeComplaintDetail.value.images?.length < 3) {
-    return ElMessage.error("至少上传三张图片");
-  }
-  await request.post(`/mallService/mechanism/shop/complaint/complete`, {
-    id: complaint.value.id,
-    comment: completeComplaintDetail.value.comment,
-    images: completeComplaintDetail.value.images.map(v => v.url)
-  });
-  ElMessage.success("操作成功");
-  complaintInfoVisible.value = false;
-  completeComplaintVisible.value = false;
-  getComplaint();
-};
-const getSubsidyDetail = () => {
-  request
-    .get(
-      `mallService/mechanism/subsidy/service?id=${state.data.subsidyServiceId}`
-    )
-    .then(resp => {
-      state.subsidyDetail = resp.data;
-    });
-};
-</script>
-
-<style scoped>
-.data {
-  display: flex;
-  margin-bottom: 50px;
-}
-.data .data-item {
-  flex: 1;
-  margin: 0 10px;
-}
-.el-table {
-  border: 1px solid #ebeef5;
-  border-bottom: none;
-}
-.has-gutter th {
-  border-right: 1px solid #ebeef5;
-}
-
-.has-gutter th:last-child {
-  border-right: none;
-}
-.el-table__row td {
-  border-right: 1px solid #ebeef5;
-}
-.el-table__row td:last-child {
-  border-right: none;
-}
-</style>

+ 0 - 135
src/views/myShop/Recommend.vue

@@ -1,135 +0,0 @@
-<template>
-  <div>
-    <el-card shadow="never">
-      <div>
-        <el-button
-          type="primary"
-          @click="
-            () => {
-              visibleEditRecommend = true;
-              rowData = {};
-            }
-          "
-          >新增</el-button
-        >
-      </div>
-    </el-card>
-    <el-card shadow="never" class="mt-2">
-      <div>
-        <el-table :data="tableData" style="width: 100%">
-          <el-table-column prop="configName" label="名称"> </el-table-column>
-          <el-table-column prop="configRank" label="排序">
-            <template #default="{ row }">
-              <el-input
-                type="primary"
-                link
-                v-model="row.configRank"
-                placeholder=""
-              ></el-input>
-            </template>
-          </el-table-column>
-          <el-table-column prop="configName" label="操作" width="230">
-            <template #default="{ row }">
-              <el-button type="primary" link @click="handleEdit(row)"
-                >修改</el-button
-              >
-              <el-button
-                type="text"
-                @click="
-                  () => {
-                    visibleEditRecommendGood = true;
-                    rowData = row;
-                  }
-                "
-                >商品管理</el-button
-              >
-              <el-popconfirm
-                title="确定删除吗?"
-                confirmButtonText="确定"
-                cancelButtonText="取消"
-                @confirm="handleDelete(row.configId)"
-              >
-                <template #reference>
-                  <el-button
-                    type="danger"
-                    v-if="row.configId != tableData[0]?.configId"
-                    >删除</el-button
-                  >
-                </template>
-              </el-popconfirm>
-            </template>
-          </el-table-column>
-        </el-table>
-
-        <el-pagination
-          class="mt-4 justify-end"
-          background
-          layout="prev, pager, next"
-          :total="total"
-          :page-size="query.pageSize"
-          @current-change="changePage"
-        />
-      </div>
-    </el-card>
-    <DialogEditRecommend
-      v-model:show="visibleEditRecommend"
-      @success="onSearch"
-      :id="rowData.configId"
-    ></DialogEditRecommend>
-    <DialogRecommendGood
-      v-model:show="visibleEditRecommendGood"
-      :id="rowData.configId"
-    ></DialogRecommendGood>
-  </div>
-</template>
-<script lang="ts" setup>
-import { request } from "@/utils";
-import { ElMessage } from "element-plus";
-import { onMounted, ref } from "vue";
-import DialogEditRecommend from "./components/DialogEditRecommend.vue";
-import DialogRecommendGood from "./components/DialogRecommendGood.vue";
-const visibleEditRecommend = ref(false);
-const visibleEditRecommendGood = ref(false);
-const tableData = ref([]);
-const query = ref({
-  page: 1,
-  pageSize: 10
-});
-const total = ref(0);
-const rowData = ref({});
-const onSearch = () => {
-  query.value.page = 1;
-  getList();
-};
-const getList = () => {
-  request
-    .get("/mallService/mechanism/indexConfigs", {
-      params: query.value
-    })
-    .then(resp => {
-      tableData.value = resp.data.list;
-      total.value = resp.data.total;
-    });
-};
-const changePage = page => {
-  query.value.page = page;
-  getList();
-};
-const handleDelete = id => {
-  request
-    .post("/mallService/mechanism/indexConfigs/delete", {
-      ids: [id]
-    })
-    .then(resp => {
-      ElMessage.success(resp.message);
-      getList();
-    });
-};
-const handleEdit = row => {
-  rowData.value = row;
-  visibleEditRecommend.value = true;
-};
-onMounted(() => {
-  onSearch();
-});
-</script>

+ 0 - 194
src/views/myShop/Store.vue

@@ -1,194 +0,0 @@
-<template>
-  <div>
-    <el-card shadow="never">
-      <div class="flex justify-between w-full">
-        <el-button type="primary" @click="handleAdd" v-if="!state.total">
-          新建店铺
-        </el-button>
-        <div v-else></div>
-        <div class="text-right flex items-center">
-          <el-select placeholder="全部店铺类型" v-model="state.query.type">
-            <el-option label="全部状态类型" :value="-1" />
-            <el-option
-              :label="item.k"
-              :value="item.v"
-              v-for="item in typeList"
-              :key="item.v"
-            />
-          </el-select>
-          <el-select
-            class="ml-2"
-            placeholder="全部店铺可用状态"
-            v-model="state.query.status"
-          >
-            <el-option label="所有状态" :value="-1" />
-            <el-option label="可用" :value="0" />
-            <el-option label="禁用" :value="1" />
-          </el-select>
-          <el-input
-            v-model="state.query.name"
-            placeholder="输入店铺名称"
-            clearable
-            class="w-1/3 ml-2"
-          ></el-input>
-          <el-button class="ml-2" type="primary" @click="onSearch"
-            >搜索</el-button
-          >
-        </div>
-      </div>
-    </el-card>
-    <el-card shadow="never" class="mt-2">
-      <el-table :data="state.list" style="width: 100%">
-        <el-table-column
-          label="店铺名称"
-          prop="name"
-          width=""
-        ></el-table-column>
-        <el-table-column
-          label="店铺类型"
-          prop="type"
-          width=""
-          :formatter="v => typeList[v.type]?.k"
-        ></el-table-column>
-        <el-table-column
-          label="店铺所属"
-          prop="belongTo"
-          width=""
-        ></el-table-column>
-        <el-table-column label="可用状态" prop="status" width="">
-          <template #default="{ row }">
-            <el-button v-if="row.status === 0" link type="success"
-              >可用</el-button
-            >
-            <el-button v-else link type="danger">禁用</el-button>
-          </template>
-        </el-table-column>
-        <el-table-column
-          label="商品数量"
-          prop="goodsCount"
-          width=""
-        ></el-table-column>
-        <el-table-column
-          label="创建时间"
-          prop="createdAt"
-          width=""
-        ></el-table-column>
-
-        <el-table-column label="操作">
-          <template #default="{ row }">
-            <!-- <el-button type="primary" link @click="handleEdit(row)">{{
-              row.type == 1 ? "查看" : "编辑"
-            }}</el-button> -->
-            <el-button type="primary" link @click="handleEdit(row)"
-              >编辑</el-button
-            >
-          </template>
-        </el-table-column>
-      </el-table>
-
-      <el-pagination
-        class="mt-4 justify-end"
-        background
-        layout="prev, pager, next"
-        :total="state.total"
-        @current-change="changePage"
-      />
-    </el-card>
-    <ComponentDialogEditStore
-      v-model:show="state.visibleStore"
-      :id="state.rowData?.id"
-      @success="onSearch"
-    ></ComponentDialogEditStore>
-    <ComponentDialogSettingStoreStatus
-      v-model:show="state.visibleSetting"
-      :id="state.rowData?.id"
-      @success="getList"
-    ></ComponentDialogSettingStoreStatus>
-  </div>
-</template>
-<script lang="ts" setup>
-import { request } from "@/utils";
-import { ElMessage } from "element-plus";
-import { reactive, ref } from "vue";
-import ComponentDialogEditStore from "./components/DialogEditStore.vue";
-import ComponentDialogSettingStoreStatus from "./components/DialogSettingStoreStatus.vue";
-import { useUserStoreHook } from "@/store/modules/user";
-const channelId = useUserStoreHook()?.profile.id;
-const state = reactive({
-  visibleStore: false,
-  visibleSetting: false,
-  rowData: {},
-  query: {
-    page: 1,
-    pageSize: 10, //
-    type: -1, //  -1:所有;0:自营;1:第三方
-    status: -1, // -1:所有状态;0:可用;1:不可用
-    name: undefined
-  },
-  list: [],
-  total: 0
-});
-const staffInfo = ref({});
-const typeList = [
-  {
-    k: "自营",
-    v: 0
-  },
-  {
-    k: "第三方",
-    v: 1
-  }
-];
-const changePage = page => {
-  state.query.page = page;
-  getList();
-};
-const getList = () => {
-  request
-    .get("/articleService/serviceProvider/staff/shop/paginate", {
-      params: state.query
-    })
-    .then(resp => {
-      state.list = resp.data.list;
-      state.total = resp.data.total;
-    });
-};
-const handleAdd = () => {
-  state.rowData = {};
-  state.visibleStore = true;
-};
-const handleEdit = rowData => {
-  state.rowData = rowData;
-  state.visibleStore = true;
-};
-const handleDelete = id => {
-  request
-    .post("/articleService/serviceProvider/shop/delete", {
-      id
-    })
-    .then(resp => {
-      ElMessage.success(resp.message);
-      getList();
-    });
-};
-const getStaff = () => {
-  request
-    .get("/articleService/serviceProvider/staff", {
-      params: {
-        mechanismId: channelId
-      }
-    })
-    .then(resp => {
-      staffInfo.value = resp.data;
-    });
-};
-const onSearch = () => {
-  state.query.page = 1;
-  getList();
-};
-const init = () => {
-  getList();
-  getStaff();
-};
-init();
-</script>

+ 0 - 109
src/views/myShop/Subsidy.vue

@@ -1,109 +0,0 @@
-<template>
-  <div>
-    <el-card shadow="naver">
-      <el-row :gutter="10">
-        <el-button
-          type="primary"
-          :icon="Plus"
-          @click="
-            () => {
-              state.subsidyId = undefined;
-              state.visibleSubsidy = true;
-            }
-          "
-          >新增</el-button
-        >
-        <el-button type="primary" @click="state.visibleTarget = true"
-          >补贴对象管理</el-button
-        >
-      </el-row>
-      <el-row :gutter="10">
-        <el-col :span="6"></el-col>
-      </el-row>
-      <el-table :data="state.list" style="width: 100%" class="mt-6">
-        <el-table-column
-          label="服务项目"
-          :formatter="v => v.category.categoryName"
-        >
-        </el-table-column>
-        <el-table-column prop="houseServicePrice" label="上门服务补贴金额">
-        </el-table-column>
-        <el-table-column prop="nonHouseServicePrice" label="非上门服务补贴金额">
-        </el-table-column>
-        <el-table-column prop="targets" label="补贴对象">
-          <template #default="{ row }">
-            <div>
-              <div v-for="(item, index) in row.targets" :key="item.id">
-                <el-text> {{ index + 1 }}、{{ item.name }} </el-text>
-              </div>
-            </div>
-          </template>
-        </el-table-column>
-        <el-table-column prop="comment" label="备注信息"> </el-table-column>
-
-        <el-table-column prop="" label="操作" width="130">
-          <template #default="{ row }">
-            <el-button type="primary" link @click="handleEdit(row.id)"
-              >编辑</el-button
-            >
-
-            <el-popconfirm
-              title="确定要删除吗?"
-              @confirm="handleDelete(row.id)"
-            >
-              <template #reference>
-                <el-button type="danger" link>删除</el-button>
-              </template>
-            </el-popconfirm>
-          </template>
-        </el-table-column>
-      </el-table>
-    </el-card>
-    <DialogSubsidyTarget v-model:show="state.visibleTarget" />
-    <DialogEditSubsidy
-      v-model:show="state.visibleSubsidy"
-      @success="getList"
-      :id="state.subsidyId"
-    />
-  </div>
-</template>
-<script lang="ts" setup>
-import { request } from "@/utils";
-import { Plus } from "@element-plus/icons-vue";
-import { ElMessage } from "element-plus";
-
-import { reactive } from "vue";
-
-import DialogSubsidyTarget from "./components/DialogSubsidyTarget.vue";
-import DialogEditSubsidy from "./components/DialogEditSubsidy.vue";
-const state = reactive({
-  list: [],
-  subsidyId: undefined,
-  visibleTarget: false,
-  visibleSubsidy: false
-});
-const getList = () => {
-  request.get("mallService/mechanism/subsidy/services").then(resp => {
-    state.list = resp.data;
-  });
-};
-
-const handleDelete = id => {
-  request
-    .post("mallService/mechanism/subsidy/service/delete", {
-      id
-    })
-    .then(resp => {
-      ElMessage.success(resp.message);
-      getList();
-    });
-};
-const handleEdit = id => {
-  state.visibleSubsidy = true;
-  state.subsidyId = id;
-};
-const initData = () => {
-  getList();
-};
-initData();
-</script>

+ 0 - 157
src/views/myShop/Swiper.vue

@@ -1,157 +0,0 @@
-<template>
-  <div>
-    <el-card class="swiper-container">
-      <template #header>
-        <div class="header">
-          <el-button type="primary" :icon="Plus" @click="handleAdd"
-            >增加</el-button
-          >
-          <el-popconfirm
-            title="确定删除吗?"
-            confirmButtonText="确定"
-            cancelButtonText="取消"
-            @confirm="handleDelete"
-          >
-            <template #reference>
-              <el-button type="danger" :icon="Delete">批量删除</el-button>
-            </template>
-          </el-popconfirm>
-        </div>
-      </template>
-      <el-table
-        :load="state.loading"
-        ref="multipleTable"
-        :data="state.tableData"
-        tooltip-effect="dark"
-        style="width: 100%"
-        @selection-change="handleSelectionChange"
-      >
-        <el-table-column type="selection" width="55"> </el-table-column>
-        <el-table-column label="轮播图" width="300">
-          <template #default="scope">
-            <div>
-              <el-image
-                :src="scope.row.carouselUrl"
-                :preview-src-list="[scope.row.carouselUrl]"
-                preview-teleported
-                class="rounded"
-                mode="cover"
-                style="width: 100px; height: 100px"
-              ></el-image>
-            </div>
-          </template>
-        </el-table-column>
-        <el-table-column label="跳转链接">
-          <template #default="scope">
-            <el-link target="_blank" :href="scope.row.redirectUrl">{{
-              scope.row.redirectUrl
-            }}</el-link>
-          </template>
-        </el-table-column>
-        <el-table-column prop="carouselRank" label="排序值" width="120">
-        </el-table-column>
-        <el-table-column prop="createTime" label="添加时间" width="200">
-        </el-table-column>
-        <el-table-column prop="" label="操作" width="100">
-          <template #default="{ row }">
-            <el-button type="primary" link @click="handleEdit(row.carouselId)"
-              >详情</el-button
-            >
-          </template>
-        </el-table-column>
-      </el-table>
-      <el-pagination
-        class="mt-4 justify-end"
-        background
-        layout="prev, pager, next"
-        :total="state.total"
-        :page-size="state.pageSize"
-        :current-page="state.currentPage"
-        @current-change="changePage"
-      />
-    </el-card>
-    <DialogAddSwiper ref="addSwiper" @success="onSearch" :type="state.type" />
-  </div>
-</template>
-
-<script setup>
-import { onMounted, reactive, ref, toRefs } from "vue";
-import { ElMessage } from "element-plus";
-import { Plus, Delete } from "@element-plus/icons-vue";
-import { request } from "@/utils/http";
-
-// import axios from '@/utils/axios'
-import DialogAddSwiper from "./components/DialogAddSwiper.vue";
-
-const addSwiper = ref();
-const state = reactive({
-  loading: false,
-  tableData: [], // 数据列表
-  currentPage: 1,
-  pageSize: 10,
-  type: "add", // 操作类型,
-  multipleSelection: [], // 选中项
-  total: 0 // 总条数
-});
-const multipleTable = ref(null);
-
-onMounted(() => {
-  onSearch();
-});
-const onSearch = () => {
-  state.currentPage = 1;
-  getCarousels();
-};
-
-// 获取轮播图列表
-const getCarousels = () => {
-  state.loading = true;
-  request
-    .get("/mallService/mechanism/carousels", {
-      params: {
-        page: state.currentPage,
-        pageSize: state.pageSize
-      }
-    })
-    .then(res => {
-      state.tableData = res.data.list;
-      state.total = res.data.total;
-      state.loading = false;
-    });
-};
-// 添加轮播项
-const handleAdd = () => {
-  state.type = "add";
-  addSwiper.value.open();
-};
-// 修改轮播图
-const handleEdit = id => {
-  state.type = "edit";
-  addSwiper.value.open(id);
-};
-// 选中之后的change方法,一旦选项有变化,就会触发该方法。
-const handleSelectionChange = val => {
-  state.multipleSelection = val;
-};
-// 批量删除
-const handleDelete = () => {
-  if (!state.multipleSelection.length) {
-    ElMessage.error("请选择项");
-    return;
-  }
-  request
-    .post("/mallService/mechanism/carousels/delete", {
-      ids: state.multipleSelection.map(i => i.carouselId)
-    })
-    .then(() => {
-      ElMessage.success("删除成功");
-      getCarousels();
-    });
-};
-const changePage = val => {
-  state.currentPage = val;
-  getCarousels();
-};
-</script>
-
-<style></style>

+ 0 - 135
src/views/myShop/components/DialogAddCategory.vue

@@ -1,135 +0,0 @@
-<template>
-  <el-dialog
-    :title="type == 'add' ? '添加分类' : '修改分类'"
-    v-model="state.visible"
-    width="400px"
-  >
-    <el-form
-      :model="state.ruleForm"
-      :rules="state.rules"
-      ref="formRef"
-      label-width="130px"
-      class="good-form"
-    >
-      <el-form-item
-        :label="state.isSecondaryCategory ? '二级分类名称' : '分类名称'"
-        prop="name"
-      >
-        <el-input type="primary" link v-model="state.ruleForm.name"></el-input>
-      </el-form-item>
-      <el-form-item label="排序值" prop="rank">
-        <el-input type="number" v-model="state.ruleForm.rank"></el-input>
-      </el-form-item>
-    </el-form>
-    <template #footer>
-      <span class="dialog-footer">
-        <el-button @click="state.visible = false">取 消</el-button>
-        <el-button type="primary" @click="submitForm">确 定</el-button>
-      </span>
-    </template>
-  </el-dialog>
-</template>
-
-<script lang="ts" setup>
-import { reactive, ref, nextTick } from "vue";
-import { useRoute } from "vue-router";
-import { request } from "@/utils";
-import { ElMessage } from "element-plus";
-
-const props = defineProps({
-  type: String, // 用于判断是添加还是编辑
-  reload: Function // 添加或修改完后,刷新列表页
-});
-
-const formRef = ref(null);
-const route = useRoute();
-const state = reactive({
-  visible: false,
-  categoryLevel: 1,
-  parentId: 0,
-  isSecondaryCategory: false,
-  ruleForm: {
-    name: "",
-    rank: ""
-  },
-  rules: {
-    name: [{ required: "true", message: "名称不能为空", trigger: ["change"] }],
-    rank: [{ required: "true", message: "编号不能为空", trigger: ["change"] }]
-  },
-  id: ""
-});
-// 获取详情
-const getDetail = id => {
-  request.get(`/mallService/mechanism/category/${id}`).then(res => {
-    state.ruleForm = {
-      name: res.data.categoryName,
-      rank: res.data.categoryRank
-    };
-    state.parentId = res.data.parentId;
-    state.categoryLevel = res.data.categoryLevel;
-  });
-};
-// 开启弹窗
-const open = (id = 0, isSecondaryCategory = false) => {
-  state.isSecondaryCategory = isSecondaryCategory;
-  state.visible = true;
-  console.log("id", id);
-
-  nextTick(() => {
-    formRef.value.resetFields();
-  });
-  state.id = id;
-  if (id && !isSecondaryCategory) {
-    // 如果是有 id 传入,证明是修改模式
-    getDetail(id);
-  } else {
-    // 否则为新增模式
-    // 新增类目,从路由获取分类 level 级别和父分类 id
-    const { level = 1, parent_id = 0 } = route.query;
-    state.ruleForm = {
-      name: "",
-      rank: ""
-    };
-  }
-};
-// 关闭弹窗
-const close = () => {
-  state.visible = false;
-};
-const submitForm = () => {
-  formRef.value.validate(valid => {
-    if (valid) {
-      if (props.type == "add") {
-        // 添加方法
-        request
-          .post("/mallService/mechanism/category", {
-            categoryName: state.ruleForm.name,
-            categoryRank: Number(state.ruleForm.rank),
-            parentId: state.id
-          })
-          .then(() => {
-            ElMessage.success("添加成功");
-            state.visible = false;
-            // 接口回调之后,运行重新获取列表方法 reload
-            if (props.reload) props.reload();
-          });
-      } else {
-        // 修改方法
-        request
-          .put("/mallService/mechanism/category", {
-            categoryId: state.id,
-            categoryName: state.ruleForm.name,
-            categoryRank: Number(state.ruleForm.rank)
-          })
-          .then(() => {
-            ElMessage.success("修改成功");
-            state.visible = false;
-            // 接口回调之后,运行重新获取列表方法 reload
-            if (props.reload) props.reload();
-          });
-      }
-    }
-  });
-};
-defineExpose({ open, close });
-</script>

+ 0 - 263
src/views/myShop/components/DialogAddSwiper.vue

@@ -1,263 +0,0 @@
-<template>
-  <el-dialog
-    :title="type == 'add' ? '添加轮播图' : '修改轮播图'"
-    v-model="state.visible"
-    width="50%"
-  >
-    <el-form
-      :model="state.ruleForm"
-      :rules="state.rules"
-      ref="formRef"
-      label-width="100px"
-      class="good-form"
-    >
-      <el-form-item label="图片" prop="url">
-        <!-- <el-upload
-          class="avatar-uploader"
-          :action="state.uploadImgServer"
-          accept="jpg,jpeg,png"
-          :headers="{
-            token: state.token
-          }"
-          :show-file-list="false"
-          :before-upload="handleBeforeUpload"
-          :on-success="handleUrlSuccess"
-        >
-          <img style="width: 200px; height: 100px; border: 1px solid #e9e9e9;" v-if="state.ruleForm.url" :src="state.ruleForm.url" class="avatar">
-          <el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
-        </el-upload> -->
-        <el-upload
-          class="avatar-uploader"
-          :show-file-list="false"
-          :before-upload="beforeAvatarUpload"
-          :http-request="simpleImgHttpUpload"
-        >
-          <img
-            v-if="state.ruleForm.url"
-            :src="state.ruleForm.url"
-            class="avatar"
-          />
-          <el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
-        </el-upload>
-      </el-form-item>
-      <el-form-item required label="商品名称">
-        <el-select
-          style="width: 300px"
-          v-model="state.goodsId"
-          @change="handleChangeGoods"
-          filterable
-          clearable
-          placeholder="请选择商品"
-        >
-          <el-option
-            v-for="item in state.goodsList"
-            :key="item.goodsId"
-            :label="`${item.goodsName}(ID: ${item.mechanismId}) `"
-            :value="item.goodsId"
-          />
-        </el-select>
-      </el-form-item>
-      <el-form-item label="跳转链接" prop="link">
-        <el-input type="primary" link v-model="state.ruleForm.link"></el-input>
-      </el-form-item>
-      <el-form-item label="排序值" prop="sort">
-        <el-input type="number" v-model="state.ruleForm.sort"></el-input>
-      </el-form-item>
-    </el-form>
-    <template #footer>
-      <span class="dialog-footer">
-        <el-button @click="state.visible = false">取 消</el-button>
-        <el-button type="primary" @click="submitForm">确 定</el-button>
-      </span>
-    </template>
-  </el-dialog>
-</template>
-
-<script lang="ts" setup>
-import { reactive, ref, defineEmits, nextTick } from "vue";
-import { request, uploadToOSS } from "@/utils";
-// import { localGet, uploadImgServer } from '@/utils'
-import { ElMessage } from "element-plus";
-import type { UploadProps } from "element-plus";
-import { Plus } from "@element-plus/icons-vue";
-import { useUserStoreHook } from "@/store/modules/user";
-const { VITE_APP_H5 } = import.meta.env;
-import UploadImage from "@/components/UploadImage.vue";
-
-const channelId = useUserStoreHook()?.profile.id;
-
-const props = defineProps({
-  type: String,
-  reload: Function
-});
-const emits = defineEmits(["success"]);
-const formRef = ref(null);
-const state = reactive({
-  visible: false,
-  goodsId: "",
-  ruleForm: {
-    url: "",
-    link: "",
-    sort: ""
-  },
-  rules: {
-    url: [{ required: "true", message: "图片不能为空", trigger: ["change"] }],
-    link: [
-      { required: "true", message: "跳转链接不能为空", trigger: ["change"] }
-    ],
-    sort: [{ required: "true", message: "排序不能为空", trigger: ["change"] }]
-  },
-  id: "",
-  goodsList: []
-});
-
-// 获取详情
-const getDetail = id => {
-  request.get(`/mallService/mechanism/carousels/${id}`).then(res => {
-    state.ruleForm = {
-      url: res.data.carouselUrl,
-      link: res.data.redirectUrl,
-      sort: res.data.carouselRank
-    };
-  });
-};
-
-const handleBeforeUpload = file => {
-  const sufix = file.name.split(".")[1] || "";
-  if (!["jpg", "jpeg", "png"].includes(sufix)) {
-    ElMessage.error("请上传 jpg、jpeg、png 格式的图片");
-    return false;
-  }
-};
-// 上传图片
-const handleUrlSuccess = val => {
-  state.ruleForm.url = val.data || "";
-};
-// 开启弹窗
-const open = id => {
-  state.visible = true;
-  getGoodList();
-  nextTick(() => {
-    formRef.value.resetFields();
-  });
-  if (id) {
-    state.id = id;
-    getDetail(id);
-  } else {
-    state.ruleForm = {
-      url: "",
-      link: "",
-      sort: ""
-    };
-  }
-};
-// 关闭弹窗
-const close = () => {
-  state.visible = false;
-};
-const submitForm = () => {
-  console.log(formRef.value.validate);
-  formRef.value.validate(valid => {
-    if (valid) {
-      if (props.type == "add") {
-        request
-          .post("/mallService/mechanism/carousels", {
-            carouselUrl: state.ruleForm.url,
-            redirectUrl: state.ruleForm.link,
-            carouselRank: Number(state.ruleForm.sort)
-          })
-          .then(() => {
-            ElMessage.success("添加成功");
-            state.visible = false;
-            emits("success");
-          });
-      } else {
-        request
-          .put("/mallService/mechanism/carousels", {
-            carouselId: state.id,
-            carouselUrl: state.ruleForm.url,
-            redirectUrl: state.ruleForm.link,
-            carouselRank: Number(state.ruleForm.sort)
-          })
-          .then(() => {
-            ElMessage.success("修改成功");
-            state.visible = false;
-            emits("success");
-          });
-      }
-    }
-  });
-};
-const beforeAvatarUpload: UploadProps["beforeUpload"] = rawFile => {
-  if (!["image/png", "image/jpeg"].includes(rawFile.type)) {
-    ElMessage.error("Avatar picture must be JPG format!");
-    return false;
-  } else if (rawFile.size / 1024 / 1024 > 2) {
-    ElMessage.error("Avatar picture size can not exceed 2MB!");
-    return false;
-  }
-  return true;
-};
-
-const simpleImgHttpUpload = options => {
-  console.log("options", options);
-  uploadToOSS(options.file, options.file.name).then(resp => {
-    state.ruleForm.url = resp;
-  });
-};
-
-// 获取商品列表
-const getGoodList = () => {
-  return new Promise(resolve => {
-    request
-      .get("/mallService/mechanism/goods/list", {
-        params: {
-          page: 1,
-          pageSize: 1000
-        }
-      })
-      .then(resp => {
-        state.goodsList = resp.data.list;
-      });
-  });
-};
-
-const handleChangeGoods = id => {
-  let url = `${VITE_APP_H5}/#/${channelId}/shop/productDetail?id=${id}`;
-  state.ruleForm.link = url;
-  // let detail = state.goodsList.find(v => v.goodsId == id);
-};
-
-defineExpose({ open, close });
-</script>
-
-<style scoped lang="scss">
-.avatar-uploader {
-  color: #ddd;
-  font-size: 30px;
-  width: 178px;
-  height: 178px;
-  text-align: center;
-}
-::v-deep .avatar-uploader .el-upload {
-  width: 100%;
-  text-align: center;
-}
-.avatar {
-  width: 178px;
-  height: 178px;
-  display: block;
-  border-radius: 10px;
-}
-.avatar-uploader-icon {
-  display: block;
-  width: 178px;
-  height: 178px;
-  border: 1px solid #e9e9e9;
-  padding: 32px 17px;
-  display: flex;
-  justify-content: center;
-  align-items: center;
-  border-radius: 10px;
-}
-</style>

+ 0 - 183
src/views/myShop/components/DialogCompleteOreder.vue

@@ -1,183 +0,0 @@
-<template>
-  <div>
-    <el-dialog title="" v-model="dialogVisible">
-      <div>
-        <el-form ref="formRef" :model="form" label-position="top">
-          <el-form-item
-            prop="subsidyTargetId"
-            label="选择该笔订单民政补贴对象类别"
-            :rules="{
-              required: true,
-              message: '请选择该笔订单民政补贴对象类别',
-              trigger: 'blur'
-            }"
-            v-if="subsidyDetail"
-          >
-            <div>
-              <el-select
-                filterable
-                v-model="form.subsidyTargetId"
-                placeholder="请选择补贴对象类别"
-              >
-                <el-option
-                  v-for="item in subsidyDetail.targets"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.id"
-                >
-                </el-option>
-              </el-select>
-              <div class="mb-8px">
-                <el-text class="text-yellow-600">{{
-                  subsidyDetail.comment
-                }}</el-text>
-              </div>
-            </div>
-          </el-form-item>
-          <el-form-item
-            label="填写交易成功备注信息"
-            prop="comment"
-            :rules="{
-              required: true,
-              message: '请填写交易成功备注信息',
-              trigger: 'blur'
-            }"
-          >
-            <el-input
-              type="textarea"
-              :autosize="{
-                minRows: 6
-              }"
-              v-model="form.comment"
-              placeholder="输入的订单交易成功备注信息用户可见,请谨慎填写"
-            ></el-input>
-          </el-form-item>
-
-          <el-form-item
-            label="上传至少3张(交易前、中、后)线下交易成功照片凭证"
-            prop="images"
-            :rules="{
-              required: true,
-              trigger: 'blur',
-              validator: validateImages
-            }"
-          >
-            <UploadOnlyImage
-              v-model:url="form.images"
-              :key="Date.now()"
-              type="image"
-            />
-          </el-form-item>
-          <el-form-item label="">
-            <el-button @click="dialogVisible = false">取 消</el-button>
-            <el-button type="primary" @click="handleSubmit">确 定</el-button>
-          </el-form-item>
-        </el-form>
-      </div>
-      <!-- <template #footer>
-        <div>
-          <el-button @click="dialogVisible = false">取 消</el-button>
-          <el-button type="primary" @click="dialogVisible = false"
-            >确 定</el-button
-          >
-        </div>
-      </template> -->
-    </el-dialog>
-  </div>
-</template>
-<script lang="ts" setup>
-import { request } from "@/utils";
-import { ElMessage } from "element-plus";
-import { ref, computed, defineProps, defineEmits, watch, reactive } from "vue";
-import UploadOnlyImage from "@/components/UploadOnlyImage.vue";
-
-const props = defineProps({
-  show: {
-    type: Boolean,
-    default: false
-  },
-  orderId: {},
-  rowData: {
-    type: Object
-  },
-  type: {
-    type: String,
-    default: "handle"
-  }
-});
-const emits = defineEmits(["update:show", "success"]);
-const form = reactive({
-  subsidyTargetId: undefined,
-  comment: undefined,
-  images: []
-});
-const formRef = ref();
-const subsidyDetail = ref(null);
-
-const dialogVisible = computed({
-  get() {
-    return props.show;
-  },
-  set(n) {
-    emits("update:show", n);
-  }
-});
-
-watch(
-  () => dialogVisible.value,
-  n => {
-    if (n) {
-      getOrderSubsidy();
-      if (props.rowData?.subsidyTargetId) {
-        let { subsidyTargetId, comment, images } = props.rowData;
-        form.subsidyTargetId = subsidyTargetId;
-        form.comment = comment;
-        form.images = images;
-      }
-    } else {
-      resetForm();
-    }
-  }
-);
-const getOrderSubsidy = () => {
-  if (!props.orderId) return;
-  request
-    .get(`mallService/mechanism/order/subsidy?orderId=${props.orderId}`)
-    .then(resp => {
-      subsidyDetail.value = resp.data;
-    });
-};
-const validateImages = (rule: any, value: any, callback: any) => {
-  if (!value.length || value.length < 3) {
-    callback(new Error("请上传至少3张(交易前、中、后)线下交易成功照片凭证"));
-  } else {
-    callback();
-  }
-};
-const handleSubmit = () => {
-  formRef.value.validate(valid => {
-    if (!valid) return;
-    request
-      .put(
-        props.type == "handle"
-          ? "/mallService/mechanism/orders/complete"
-          : "/mallService/mechanism/orders/comment",
-        {
-          ids: [props.orderId],
-          ...form,
-          images: form.images.map(v => v.url)
-        }
-      )
-      .then(resp => {
-        ElMessage.success(resp.message);
-        emits("success");
-        dialogVisible.value = false;
-      });
-  });
-};
-
-const resetForm = () => {
-  formRef.value.resetFields();
-  form.images = [];
-};
-</script>

+ 0 - 122
src/views/myShop/components/DialogEditRecommend.vue

@@ -1,122 +0,0 @@
-<template>
-  <div>
-    <el-dialog title="推荐设置" v-model="dialogVisible">
-      <div>
-        <el-form
-          :model="formData"
-          :rules="rules"
-          ref="formRef"
-          label-width="100px"
-          class="good-form"
-        >
-          <el-form-item label="名称" prop="configName">
-            <el-input
-              v-model="formData.configName"
-              placeholder="请输入名称"
-              show-word-limit
-              :maxlength="20"
-              clearable
-            ></el-input>
-          </el-form-item>
-
-          <el-form-item label="排序值" prop="configRank">
-            <el-input type="number" v-model="formData.configRank"></el-input>
-          </el-form-item>
-        </el-form>
-      </div>
-      <template #footer>
-        <div>
-          <el-button @click="dialogVisible = false">取 消</el-button>
-          <el-button type="primary" @click="submitForm">确 定</el-button>
-        </div>
-      </template>
-    </el-dialog>
-  </div>
-</template>
-<script lang="ts" setup>
-import { ref, computed, defineProps, defineEmits, watch } from "vue";
-import { request } from "@/utils";
-import { ElMessage } from "element-plus";
-
-const props = defineProps({
-  show: {
-    type: Boolean,
-    default: false
-  },
-  id: {
-    default: undefined
-  }
-});
-const emits = defineEmits(["update:show", "success"]);
-const dialogVisible = computed({
-  get() {
-    return props.show;
-  },
-  set(n) {
-    emits("update:show", n);
-  }
-});
-const name = ref("");
-const formData = ref({
-  configId: undefined,
-  configName: "",
-  configRank: ""
-});
-const formRef = ref(null);
-const rules = {
-  configName: [
-    { required: "true", message: "配置名称不能为空", trigger: ["change"] }
-  ],
-  configRank: [
-    { required: "true", message: "排序不能为空", trigger: ["change"] }
-  ]
-};
-watch(
-  () => dialogVisible.value,
-  n => {
-    if (n) {
-      if (props.id) {
-        request
-          .get(`/mallService/mechanism/indexConfigs/${props.id}`)
-          .then(resp => {
-            formData.value = {
-              configId: resp.data.configId,
-              configName: resp.data.configName,
-              configRank: resp.data.configRank
-            };
-          });
-      }
-    } else {
-      formRef.value.resetFields();
-    }
-  }
-);
-const submitForm = () => {
-  formRef.value.validate(valid => {
-    if (!valid) return;
-    if (props.id) {
-      request
-        .put("/mallService/mechanism/indexConfigs", {
-          ...formData.value,
-          configRank: Number(formData.value.configRank)
-        })
-        .then(resp => {
-          ElMessage.success(resp.message);
-          dialogVisible.value = false;
-          emits("success");
-        });
-    } else {
-      request
-        .post("/mallService/mechanism/indexConfigs", {
-          ...formData.value,
-          configRank: Number(formData.value.configRank)
-        })
-        .then(resp => {
-          ElMessage.success(resp.message);
-          dialogVisible.value = false;
-          emits("success");
-        });
-    }
-  });
-};
-</script>

+ 0 - 184
src/views/myShop/components/DialogEditRecommendGood.vue

@@ -1,184 +0,0 @@
-<template>
-  <div>
-    <el-dialog title="推荐商品设置" v-model="dialogVisible">
-      <div>
-        <el-form
-          :model="state.ruleForm"
-          :rules="state.rules"
-          ref="formRef"
-          label-width="100px"
-          class="good-form"
-        >
-          <el-form-item required label="商品名称" prop="goodsId">
-            <el-select
-              style="width: 300px"
-              v-model="state.ruleForm.goodsId"
-              filterable
-              clearable
-              placeholder="请选择商品"
-              @change="handleChangeGoods"
-            >
-              <el-option
-                v-for="item in state.goodsList"
-                :key="item.goodsId"
-                :label="`${item.goodsName}(ID: ${item.mechanismId}) `"
-                :value="item.goodsId"
-              />
-            </el-select>
-          </el-form-item>
-          <el-form-item label="跳转链接" prop="redirectUrl">
-            <el-input
-              style="width: 300px"
-              v-model="state.ruleForm.redirectUrl"
-              placeholder="请输入跳转链接"
-            ></el-input>
-          </el-form-item>
-          <el-form-item label="商品名称" prop="name">
-            <el-input
-              style="width: 300px"
-              v-model="state.ruleForm.name"
-              placeholder="请输入商品名称"
-              clearable
-            ></el-input>
-          </el-form-item>
-          <el-form-item label="排序值" prop="rank">
-            <el-input
-              style="width: 300px"
-              v-model="state.ruleForm.rank"
-              placeholder="请输入排序值"
-            ></el-input>
-          </el-form-item>
-        </el-form>
-      </div>
-      <template #footer>
-        <div>
-          <el-button @click="dialogVisible = false">取 消</el-button>
-          <el-button type="primary" @click="submitForm">确 定</el-button>
-        </div>
-      </template>
-    </el-dialog>
-  </div>
-</template>
-<script lang="ts" setup>
-import { reactive, ref, defineEmits, nextTick, computed, watch } from "vue";
-import { request } from "@/utils";
-import { ElMessage } from "element-plus";
-const props = defineProps({
-  show: {
-    type: Boolean,
-    default: false
-  },
-  id: {
-    default: undefined
-  },
-  configId: {
-    default: undefined
-  }
-});
-const emits = defineEmits(["update:show", "success"]);
-const dialogVisible = computed({
-  get() {
-    return props.show;
-  },
-  set(n) {
-    emits("update:show", n);
-  }
-});
-
-watch(
-  () => dialogVisible.value,
-  async n => {
-    if (n) {
-      await getGoodList();
-      getGoodsDetail();
-    } else {
-      nextTick(() => {
-        formRef.value.resetFields();
-      });
-    }
-  }
-);
-const formRef = ref(null);
-const state = reactive({
-  ruleForm: {
-    goodsId: "",
-    redirectUrl: "",
-    rank: "",
-    name: ""
-  },
-  rules: {
-    goodsId: [{ required: "true", message: "请选择商品", trigger: ["change"] }]
-  },
-  goodsList: []
-});
-
-// 获取商品列表
-const getGoodList = () => {
-  return new Promise(resolve => {
-    request
-      .get("/mallService/mechanism/goods/list", {
-        params: {
-          page: 1,
-          pageSize: 1000
-        }
-      })
-      .then(resp => {
-        resolve();
-        state.goodsList = resp.data.list;
-      });
-  });
-};
-
-const getGoodsDetail = () => {
-  if (!props.id) return;
-  request
-    .get(`/mallService/mechanism/indexConfigs/goods/${props.id}`)
-    .then(resp => {
-      let { name, goodsId, redirectUrl, rank } = resp.data;
-      state.ruleForm.name = name;
-      state.ruleForm.goodsId = goodsId;
-      state.ruleForm.redirectUrl = redirectUrl;
-      state.ruleForm.rank = rank;
-    });
-};
-
-const handleChangeGoods = id => {
-  let detail = state.goodsList.find(v => v.goodsId == id);
-  state.ruleForm.name = detail?.goodsName;
-};
-const submitForm = () => {
-  formRef.value.validate(valid => {
-    if (!valid) return;
-    let params = {
-      ...state.ruleForm,
-      goodsId: Number(state.ruleForm.goodsId),
-      rank: Number(state.ruleForm.rank),
-      configId: props.configId
-    };
-    if (!params.name) {
-      state.goodsList;
-      params.name = state.goodsList.find(v => {
-        state.ruleForm.goodsId == v.goodsId;
-      })?.goodsName;
-    }
-    if (props.id) {
-      params.id = props.id;
-      request
-        .put("/mallService/mechanism/indexConfigs/goods", params)
-        .then(resp => {
-          ElMessage.success(resp.message);
-          dialogVisible.value = false;
-          emits("success");
-        });
-    } else {
-      request
-        .post("/mallService/mechanism/indexConfigs/goods", params)
-        .then(resp => {
-          ElMessage.success(resp.message);
-          dialogVisible.value = false;
-          emits("success");
-        });
-    }
-  });
-};
-</script>

+ 0 - 435
src/views/myShop/components/DialogEditStore.vue

@@ -1,435 +0,0 @@
-<template>
-  <div>
-    <el-dialog
-      :title="props.id ? '编辑店铺' : '添加店铺'"
-      v-model="dialogVisible"
-    >
-      <div class="add">
-        <el-card class="add-container" shadow="never">
-          <el-form
-            :model="state.storeForm"
-            :rules="state.rules"
-            ref="goodRef"
-            label-width="100px"
-            readonly
-            :disabled="isPreview"
-            class="storeForm"
-          >
-            <el-form-item label="店铺类型" prop="type">
-              <el-select
-                v-model="state.storeForm.type"
-                placeholder="请选择店铺类型"
-                filterable
-                clearable
-                disabled
-              >
-                <el-option label="自营" :value="0" />
-                <el-option label="第三方服务商" :value="1" />
-              </el-select>
-            </el-form-item>
-            <el-form-item label="店铺所属" prop="staffId">
-              <!-- <el-cascader
-            :placeholder="state.defaultCate"
-            style="width: 400px"
-            :props="state.category"
-            @change="handleChangeCate"
-          ></el-cascader> -->
-              <el-select
-                v-model="state.storeForm.staffId"
-                filterable
-                clearable
-                placeholder="请选择服务商"
-                disabled
-              >
-                <el-option
-                  v-for="item in state.processors"
-                  :key="item.sn"
-                  :label="item.nickname"
-                  :value="item.staffId"
-                >
-                  <el-text>{{ item.nickname }}</el-text>
-                  <el-tag class="ml-2">{{ item.sn }}</el-tag>
-                </el-option>
-              </el-select>
-            </el-form-item>
-            <el-form-item label="店铺名称" prop="name">
-              <el-input
-                style="width: 400px"
-                v-model="state.storeForm.name"
-                placeholder="请输入店铺名称"
-              ></el-input>
-            </el-form-item>
-            <el-form-item label="营业时间" prop="serveTime">
-              <el-input
-                style="width: 400px"
-                v-model="state.storeForm.serveTime"
-                placeholder="请输入营业时间,如:周一至周五,10:00-21:00"
-              ></el-input>
-            </el-form-item>
-            <el-form-item label="客服电话" prop="hotline">
-              <el-input
-                style="width: 400px"
-                v-model="state.storeForm.hotline"
-                placeholder="请输入客服电话"
-              ></el-input>
-            </el-form-item>
-            <el-form-item label="店铺地址" prop="address">
-              <el-input
-                style="width: 400px"
-                v-model="state.storeForm.address"
-                placeholder="请输入店铺地址"
-              ></el-input>
-            </el-form-item>
-            <el-form-item required label="店铺logo" prop="logo">
-              <div>
-                <UploadOnlyImage
-                  v-model:url="state.storeForm.logo"
-                  :key="coverKey"
-                  type="image"
-                  isSimple
-                  :isPreview="isPreview"
-                  :limit="1"
-                />
-                <div>
-                  <el-text>说明:支持png、jpg图片,建议尺寸:128*128</el-text>
-                </div>
-              </div>
-            </el-form-item>
-            <el-form-item required label="店铺图片" prop="images">
-              <div>
-                <UploadOnlyImage
-                  v-model:url="state.storeForm.images"
-                  :key="coverKey"
-                  type="image"
-                  :isPreview="isPreview"
-                />
-                <!-- <UploadImage
-                  v-model:url="state.storeForm.images"
-                  :key="coverKey"
-                  type="image"
-                /> -->
-                <div>
-                  <el-text
-                    >说明:支持png、jpg图片,建议尺寸:375*200
-                    ,最多上传9张,第一张默认为主图</el-text
-                  >
-                </div>
-              </div>
-            </el-form-item>
-
-            <el-form-item label="店铺简介" prop="intro">
-              <el-input
-                style="width: 400px"
-                type="textarea"
-                :rows="5"
-                v-model="state.storeForm.intro"
-                placeholder="请输入店铺简介"
-              ></el-input>
-            </el-form-item>
-            <el-form-item v-if="!isPreview">
-              <el-button @click="dialogVisible = false">取消</el-button>
-              <el-button type="primary" @click="submitAdd()">{{
-                props.id ? "立即修改" : "立即创建"
-              }}</el-button>
-            </el-form-item>
-          </el-form>
-        </el-card>
-      </div>
-    </el-dialog>
-  </div>
-</template>
-<script lang="ts" setup>
-import {
-  ref,
-  reactive,
-  computed,
-  defineProps,
-  defineEmits,
-  watch,
-  onMounted,
-  onBeforeUnmount,
-  getCurrentInstance
-} from "vue";
-
-import { request, uploadToOSS } from "@/utils/index";
-import { ElMessage } from "element-plus";
-import type { UploadProps } from "element-plus";
-import { Plus } from "@element-plus/icons-vue";
-import Editor from "@/components/Editor.vue";
-import UploadOnlyImage from "@/components/UploadOnlyImage.vue";
-import UploadImage from "@/components/UploadImage.vue";
-import { useRoute, useRouter } from "vue-router";
-import { useUserStoreHook } from "@/store/modules/user";
-const channelId = useUserStoreHook()?.profile.id;
-const props = defineProps({
-  show: {
-    type: Boolean,
-    default: false
-  },
-  id: {
-    type: Number
-  }
-});
-const emits = defineEmits(["update:show", "success"]);
-const dialogVisible = computed({
-  get() {
-    return props.show;
-  },
-  set(n) {
-    emits("update:show", n);
-  }
-});
-const isPreview = computed(() => {
-  return false;
-  return state.detail?.type == 1;
-});
-const goodRef = ref(null);
-
-watch(
-  () => dialogVisible.value,
-  n => {
-    if (n) {
-      getStaff();
-
-      getDetail();
-    } else {
-      goodRef?.value?.resetFields();
-    }
-  }
-);
-watch(
-  () => props.id,
-  n => {
-    getDetail();
-    getStaff();
-  }
-);
-
-const { proxy } = getCurrentInstance();
-const coverKey = ref(Date.now());
-const editor = ref(null);
-const route = useRoute();
-const router = useRouter();
-const { id } = route.query;
-
-const state = reactive({
-  detail: {},
-  id: id,
-  defaultCate: "",
-  storeForm: {
-    type: 0, // 类型
-    staffId: "", // 服务商
-    name: undefined,
-    serveTime: "",
-    hotline: "",
-    address: "",
-    logo: [],
-    intro: "",
-    images: []
-  },
-  processors: [],
-  rules: {
-    name: [
-      { required: "true", message: "请填写店铺名称", trigger: ["change"] }
-    ],
-    type: [
-      { required: "true", message: "请选择店铺类型", trigger: ["change"] }
-    ],
-    staffId: [
-      { required: "true", message: "请选择服务商", trigger: ["change"] }
-    ],
-    serveTime: [
-      { required: "true", message: "请填写店铺营业时间", trigger: ["change"] }
-    ],
-    hotline: [
-      { required: "true", message: "请填写客服电话", trigger: ["change"] }
-    ],
-    address: [
-      { required: "true", message: "请填写店铺地址", trigger: ["change"] }
-    ],
-    logo: [
-      { required: "true", message: "请上传店铺LOGO", trigger: ["change"] }
-    ],
-    images: [
-      { required: "true", message: "请上传店铺图片", trigger: ["change"] }
-    ]
-  },
-  categoryId: "",
-  category: {
-    lazy: true,
-    lazyLoad(node, resolve) {
-      const { level = 0, value } = node;
-      request
-        .get("/mallService/mechanism/category", {
-          params: {
-            page: 1,
-            pageSize: 1000,
-            categoryLevel: level + 1,
-            parentId: value || 0
-          }
-        })
-        .then(res => {
-          const list = res.data.list;
-          const nodes = list.map(item => ({
-            value: item.categoryId,
-            label: item.categoryName,
-            leaf: level > 1
-          }));
-          resolve(nodes);
-        });
-    }
-  }
-});
-
-const staffInfo = ref({});
-const categoryList = ref([]);
-let instance;
-onMounted(async () => {
-  // getProcessors();
-
-  await initCategory();
-  if (id) {
-    request.get(`/mallService/mechanism/goods/${id}`).then(res => {
-      const { goods, firstCategory, secondCategory, thirdCategory, category } =
-        res?.data;
-      state.storeForm = {
-        name: goods.name,
-        intro: goods.intro,
-        originalPrice: goods.originalPrice / 100,
-        sellingPrice: goods.sellingPrice / 100,
-        stockNum: goods.stockNum,
-        goodsSellStatus: String(goods.goodsSellStatus),
-        logo: goods.logo,
-        tag: goods.tag,
-        goodsDetailContent: goods.goodsDetailContent,
-        goodsCategoryId: category.categoryId
-      };
-      state.categoryId = goods.goodsCategoryId;
-      state.defaultCate = `${firstCategory.categoryName}/${secondCategory.categoryName}/${thirdCategory.categoryName}`;
-      if (instance) {
-        // 初始化店铺详情 html
-        instance.txt.html(goods.goodsDetailContent);
-      }
-    });
-  }
-});
-onBeforeUnmount(() => {
-  // instance.destroy();
-  instance = null;
-});
-const getDetail = () => {
-  if (!props.id) {
-    return;
-  }
-  request
-    .get(`/articleService/serviceProvider/shop?id=${props.id}`)
-    .then(resp => {
-      state.detail = resp.data;
-      state.storeForm = {
-        ...resp.data,
-        logo: [{ url: resp.data.logo, name: "logo" }],
-        images: resp.data.images.map((v, i) => {
-          return {
-            url: v,
-            name: "images" + i,
-            status: "success",
-            uid: new Date().getTime()
-          };
-        })
-      };
-      console.log(state.storeForm);
-    });
-};
-
-const getStaff = () => {
-  request
-    .get("/articleService/serviceProvider/staff", {
-      params: {
-        mechanismId: channelId
-      }
-    })
-    .then(resp => {
-      staffInfo.value = resp.data;
-      state.storeForm.staffId = resp.data.staffId;
-      state.processors = [resp.data];
-    });
-};
-const initCategory = () => {
-  return new Promise(resolve => {
-    request
-      .get("/mallService/mechanism/category", {
-        params: {
-          page: 1,
-          pageSize: 1000
-        }
-      })
-      .then(res => {
-        const list = res.data.list;
-        categoryList.value = list;
-        resolve();
-      });
-  });
-};
-const submitAdd = () => {
-  goodRef.value.validate(vaild => {
-    if (vaild) {
-      // 默认新增用 post 方法
-      let params = {
-        ...state.storeForm,
-        logo: state.storeForm.logo[0].url,
-        images: state.storeForm.images.map(v => v.url)
-      };
-      if (props.id) {
-        // 修改店铺使用 put 方法
-        request
-          .post("/articleService/serviceProvider/shop/update", params)
-          .then(resp => {
-            ElMessage.success(resp.message);
-            dialogVisible.value = false;
-            emits("success");
-          });
-      } else {
-        request
-          .post("/articleService/serviceProvider/shop", params)
-          .then(resp => {
-            ElMessage.success(resp.message);
-            // router.push({ path: "/shop/store" });
-            dialogVisible.value = false;
-            emits("success");
-          });
-      }
-    }
-  });
-};
-
-const getProcessors = () => {
-  request.get("/articleService/demand/processors").then(resp => {
-    state.processors = resp.data;
-  });
-};
-</script>
-
-<style scoped>
-.add {
-  display: flex;
-}
-.add-container {
-  flex: 1;
-  height: 100%;
-}
-.avatar-uploader {
-  width: 160px;
-  height: 160px;
-  color: #ddd;
-  font-size: 30px;
-}
-.avatar-uploader-icon {
-  display: block;
-  width: 160px;
-  height: 160px;
-  border: 1px solid #e9e9e9;
-  padding: 32px 17px;
-  display: flex;
-  justify-content: center;
-}
-</style>

+ 0 - 234
src/views/myShop/components/DialogEditSubsidy.vue

@@ -1,234 +0,0 @@
-<template>
-  <div>
-    <el-dialog title="" v-model="dialogVisible">
-      <div>
-        <el-form ref="formRef" :model="form" label-width="180px">
-          <el-form-item
-            label="选择补贴的商品分类"
-            prop="categoryId"
-            :rules="{
-              required: true,
-              message: '请选择补贴的商品分类',
-              trigger: 'change'
-            }"
-          >
-            <el-cascader
-              :props="cascaderProps"
-              collapse-tags
-              clearable
-              v-model="form.categoryId"
-            ></el-cascader>
-          </el-form-item>
-          <el-form-item
-            label="上门服务补贴金额"
-            prop="houseServicePrice"
-            :rules="{
-              required: true,
-              message: '请输入上门服务补贴金额',
-              trigger: 'blur'
-            }"
-          >
-            <el-input
-              v-model="form.houseServicePrice"
-              placeholder="请输入上门服务补贴金额"
-              clearable
-            ></el-input>
-          </el-form-item>
-          <el-form-item
-            label="非上门服务补贴金额"
-            prop="nonHouseServicePrice"
-            :rules="{
-              required: true,
-              message: '请输入非上门服务补贴金额',
-              trigger: 'blur'
-            }"
-          >
-            <el-input
-              v-model="form.nonHouseServicePrice"
-              placeholder="请输入非上门服务补贴金额"
-              clearable
-            ></el-input>
-          </el-form-item>
-          <el-form-item
-            label="补贴对象"
-            prop="subsidyTargetIds"
-            :rules="{
-              required: true,
-              message: '请输入非上门服务补贴金额',
-              trigger: 'blur'
-            }"
-          >
-            <el-select
-              v-model="form.subsidyTargetIds"
-              placeholder="请选择补贴对象"
-              multiple
-              clearable
-            >
-              <el-option
-                v-for="item in subsidyTargetList"
-                :key="item.id"
-                :label="item.name"
-                :value="item.id"
-              >
-              </el-option>
-            </el-select>
-          </el-form-item>
-          <el-form-item
-            label="备注信息"
-            prop="comment"
-            :rules="{
-              required: true,
-              message: '请输入备注信息',
-              trigger: 'blur'
-            }"
-          >
-            <el-input
-              type="textarea"
-              :autosize="{
-                minRows: 8
-              }"
-              v-model="form.comment"
-              placeholder="请输入备注"
-            ></el-input>
-          </el-form-item>
-          <el-form-item label="">
-            <el-button type="primary" @click="handleSubmit">确 定</el-button>
-            <el-button @click="dialogVisible = false">取 消</el-button>
-          </el-form-item>
-        </el-form>
-      </div>
-      <template #footer>
-        <div></div>
-      </template>
-    </el-dialog>
-  </div>
-</template>
-<script lang="ts" setup>
-import { request } from "@/utils";
-import { ElMessage } from "element-plus";
-import { ref, computed, defineProps, defineEmits, watch, reactive } from "vue";
-const props = defineProps({
-  show: {
-    type: Boolean,
-    default: false
-  },
-  id: {
-    type: Number
-  }
-});
-const emits = defineEmits(["update:show", "success"]);
-const dialogVisible = computed({
-  get() {
-    return props.show;
-  },
-  set(n) {
-    emits("update:show", n);
-  }
-});
-
-watch(
-  () => dialogVisible.value,
-  n => {
-    if (n) {
-      getSubsidyTarget();
-      initData();
-    } else {
-      resetForm();
-    }
-  }
-);
-
-const form = reactive({
-  categoryId: undefined,
-  houseServicePrice: undefined,
-  nonHouseServicePrice: undefined,
-  subsidyTargetIds: [],
-  comment: undefined,
-  id: undefined
-});
-const list = ref([]);
-
-const formRef = ref();
-const subsidyTargetList = ref([]);
-const cascaderProps = {
-  lazy: true,
-  lazyLoad(node, resolve) {
-    const { level, value } = node;
-    console.log("node", node);
-    request
-      .get("/mallService/mechanism/category", {
-        params: {
-          page: 1,
-          pageSize: 1000,
-          parentId: value
-        }
-      })
-      .then(resp => {
-        let nodes = resp.data.list.map(v => {
-          return {
-            ...v,
-            value: v.categoryId,
-            label: v.categoryName,
-            leaf: level >= 1
-          };
-        });
-
-        resolve(nodes);
-      });
-  }
-};
-const handleSubmit = () => {
-  formRef.value.validate(valid => {
-    if (!valid) return;
-    request
-      .post(
-        form.id
-          ? "mallService/mechanism/subsidy/service/update"
-          : "mallService/mechanism/subsidy/service",
-        {
-          ...form,
-          categoryId: form.categoryId.at(-1)
-        }
-      )
-      .then(resp => {
-        ElMessage.success(resp.message);
-        emits("success");
-        dialogVisible.value = false;
-      });
-  });
-};
-
-const getSubsidyTarget = () => {
-  request.get("mallService/mechanism/subsidy/targets").then(resp => {
-    subsidyTargetList.value = resp.data;
-  });
-};
-
-const resetForm = () => {
-  formRef.value.resetFields();
-  form.id = undefined;
-};
-const initData = () => {
-  if (props.id) {
-    request
-      .get(`mallService/mechanism/subsidy/service?id=${props.id}`)
-      .then(resp => {
-        let {
-          category,
-          categoryId,
-          houseServicePrice,
-          nonHouseServicePrice,
-          comment,
-          targets,
-          id
-        } = resp.data;
-        form.categoryId = [category.parentId, categoryId];
-        form.houseServicePrice = houseServicePrice;
-        form.nonHouseServicePrice = nonHouseServicePrice;
-        form.comment = comment;
-        form.subsidyTargetIds = targets.map(v => v.id);
-        form.id = id;
-      });
-  }
-};
-</script>

+ 0 - 98
src/views/myShop/components/DialogExamineGoods.vue

@@ -1,98 +0,0 @@
-<template>
-  <div>
-    <el-dialog title="设置" v-model="dialogVisible">
-      <div>
-        <el-form label-width="auto">
-          <el-form-item label="审核状态">
-            <el-radio-group
-              v-model="state.form.status"
-              class="ml-4"
-              name="status"
-            >
-              <el-radio :label="1" size="large">通过</el-radio>
-              <el-radio :label="2" size="large">不通过</el-radio>
-            </el-radio-group>
-          </el-form-item>
-          <el-form-item label="备注信息" v-if="state.form.status == 2">
-            <el-input
-              v-model="state.form.comment"
-              type="textarea"
-              :rows="5"
-              placeholder="选填请输入不通过的理由"
-              clearable
-            />
-          </el-form-item>
-        </el-form>
-      </div>
-      <template #footer>
-        <div>
-          <el-button @click="dialogVisible = false">取 消</el-button>
-          <el-button type="primary" @click="handleSubmit">确 定</el-button>
-        </div>
-      </template>
-    </el-dialog>
-  </div>
-</template>
-<script lang="ts" setup>
-import { request } from "@/utils";
-import { ElMessage } from "element-plus";
-import { ref, computed, defineProps, defineEmits, watch, reactive } from "vue";
-const props = defineProps({
-  show: {
-    type: Boolean,
-    default: false
-  },
-  id: {
-    type: Number
-  }
-});
-const emits = defineEmits(["update:show", "success"]);
-const dialogVisible = computed({
-  get() {
-    return props.show;
-  },
-  set(n) {
-    emits("update:show", n);
-  }
-});
-
-watch(
-  () => dialogVisible.value,
-  n => {
-    if (n) {
-      getDetail();
-    } else {
-    }
-  }
-);
-const status = ref(0);
-const radio1 = ref(3);
-const state = reactive({
-  detail: {},
-  form: {
-    status: 0,
-    comment: ""
-  }
-});
-const getDetail = () => {
-  if (!props.id) {
-    return;
-  }
-  request.get(`/mallService/mechanism/goods/${props.id}`).then(resp => {
-    state.detail = resp.data;
-    state.form.status = resp.data.goods.verifyStatus;
-  });
-};
-const handleSubmit = () => {
-  request
-    .put(`/mallService/mechanism/goods/verifyStatus/${state.form.status}`, {
-      ids: [props.id],
-      comment: state.form.comment
-    })
-    .then(resp => {
-      ElMessage.success(resp.message);
-      dialogVisible.value = false;
-      emits("success");
-    });
-};
-</script>

+ 0 - 190
src/views/myShop/components/DialogExportOrder.vue

@@ -1,190 +0,0 @@
-<template>
-  <div>
-    <el-dialog title="订单导出" v-model="dialogVisible" width="30%">
-      <div>
-        <el-form ref="formRef" :model="form" label-width="200px">
-          <el-form-item
-            label="请选择订单完成的日期范围"
-            prop="time"
-            :rules="[
-              {
-                required: true,
-                message: '请选择订单完成的日期范围',
-                trigger: 'blur'
-              }
-            ]"
-          >
-            <div class="w-1/3">
-              <el-date-picker
-                v-model="form.time"
-                type="daterange"
-                start-placeholder="开始时间"
-                end-placeholder="结束时间"
-                value-format="YYYY-MM-DD"
-              />
-            </div>
-          </el-form-item>
-          <el-form-item label="订单状态" required>交易成功</el-form-item>
-          <el-form-item label="订单所属店铺" prop="shopIds">
-            <el-select
-              v-model="form.shopIds"
-              filterable
-              multiple
-              style="width: 200px; margin-right: 10px"
-            >
-              <el-option
-                v-for="item in shopList"
-                :key="item.id"
-                :label="item.name"
-                :value="item.id"
-              />
-            </el-select>
-          </el-form-item>
-          <el-form-item label="">
-            <el-button type="" @click="onReset">重置</el-button>
-            <el-button type="primary" @click="onSubmit">确认</el-button>
-          </el-form-item>
-        </el-form>
-        <el-card v-if="state.loading != 'none'">
-          <template #header>
-            <span class="text-gray-500">{{
-              state.loading == "loading"
-                ? "订单生成中,请稍后..."
-                : "订单已完成"
-            }}</span>
-            <el-button type="primary" class="ml-4" plain @click="refreshDetail"
-              >刷新</el-button
-            >
-          </template>
-          <div>
-            <el-table
-              :data="state.fileList"
-              :show-header="false"
-              style="width: 100%"
-            >
-              <el-table-column prop="" label="">
-                <template #default="{ row }">
-                  {{ row.filename }}
-                </template>
-              </el-table-column>
-              <el-table-column prop="操作" label="">
-                <template #default="{ row }">
-                  <el-link
-                    type="success"
-                    :href="`${VITE_APP_DOMAIN}/mallService/orders/export/download?id=${row.id}`"
-                    target="download"
-                    v-if="state.loading == 'success'"
-                    >下载</el-link
-                  >
-                </template>
-              </el-table-column>
-            </el-table>
-          </div>
-        </el-card>
-      </div>
-      <!-- <template #footer>
-        <div>
-          <el-button @click="dialogVisible = false">取 消</el-button>
-          <el-button type="primary" @click="dialogVisible = false"
-            >确 定</el-button
-          >
-        </div>
-      </template> -->
-    </el-dialog>
-  </div>
-</template>
-<script lang="ts" setup>
-import { ref, computed, defineProps, defineEmits, watch, reactive } from "vue";
-import { request, downloadFile } from "@/utils";
-const { VITE_APP_DOMAIN } = import.meta.env;
-const props = defineProps({
-  show: {
-    type: Boolean,
-    default: false
-  }
-});
-const emits = defineEmits(["update:show"]);
-const dialogVisible = computed({
-  get() {
-    return props.show;
-  },
-  set(n) {
-    emits("update:show", n);
-  }
-});
-
-watch(
-  () => dialogVisible.value,
-  n => {
-    if (n) {
-      getShopList();
-    } else {
-      onReset();
-    }
-  }
-);
-
-const form = reactive({
-  time: "",
-  shopIds: undefined
-});
-const state = reactive({
-  id: "",
-  loading: "none", // none: '没有项目'  loading: '生成中' success: '完成'
-  fileList: []
-});
-const formRef = ref();
-const shopList = ref([]);
-
-const getShopList = () => {
-  request
-    .get("/articleService/serviceProvider/shop/paginate", {
-      params: {
-        page: 1,
-        pageSize: 9999,
-        type: -1,
-        status: -1
-      }
-    })
-    .then(resp => {
-      shopList.value = resp.data.list;
-    });
-};
-const onSubmit = () => {
-  console.log("form.time", form.time);
-
-  const [start, end] = form.time;
-  request
-    .get("mallService/mechanism/orders/export", {
-      params: {
-        shopIds: form.shopIds?.join(","),
-        start,
-        end
-      }
-    })
-    .then(resp => {
-      state.id = resp.data?.id;
-      state.loading = "loading";
-      getExportStatus();
-    });
-};
-const onReset = () => {
-  state.loading = "none";
-  state.fileList = [];
-  formRef.value?.resetFields();
-};
-const getExportStatus = () => {
-  request
-    .get(`mallService/mechanism/orders/export/status?id=${state.id}`)
-    .then(resp => {
-      state.fileList = [resp.data];
-      state.loading = resp.data.status == 1 ? "loading" : "success";
-    })
-    .catch(() => {
-      state.loading = "loading";
-    });
-};
-const refreshDetail = () => {
-  getExportStatus();
-};
-</script>

+ 0 - 177
src/views/myShop/components/DialogRecommendGood.vue

@@ -1,177 +0,0 @@
-<template>
-  <div>
-    <el-dialog title="商品管理" v-model="dialogVisible" width="60%">
-      <div>
-        <div class="header">
-          <el-button type="primary" :icon="Plus" @click="handleAdd"
-            >增加</el-button
-          >
-          <el-popconfirm
-            title="确定删除吗?"
-            confirmButtonText="确定"
-            cancelButtonText="取消"
-            @confirm="handleDelete"
-          >
-            <template #reference>
-              <el-button type="danger" :icon="Delete">批量删除</el-button>
-            </template>
-          </el-popconfirm>
-        </div>
-        <div>
-          <el-table
-            :data="state.tableData"
-            style="width: 100%"
-            ref="multipleTable"
-            @selection-change="handleSelectionChange"
-          >
-            <el-table-column type="selection" width="55"> </el-table-column>
-
-            <el-table-column prop="name" label="商品名称"> </el-table-column>
-            <el-table-column prop="redirectUrl" label="跳转链接">
-            </el-table-column>
-            <el-table-column prop="rank" label="排序值" width="80px">
-            </el-table-column>
-            <el-table-column prop="goodsId" label="商品编号"> </el-table-column>
-            <el-table-column prop="createTime" label="添加时间">
-            </el-table-column>
-            <el-table-column prop="" label="操作">
-              <template #default="{ row }">
-                <el-button
-                  type="primary"
-                  link
-                  class="mr-4"
-                  @click="handleEdit(row)"
-                  >修改</el-button
-                >
-                <el-popconfirm
-                  title="确定删除吗?"
-                  confirmButtonText="确定"
-                  cancelButtonText="取消"
-                  @confirm="handleDelete([row.id])"
-                >
-                  <template #reference>
-                    <el-link type="danger">删除</el-link>
-                  </template>
-                </el-popconfirm>
-              </template>
-            </el-table-column>
-          </el-table>
-          <el-pagination
-            class="mt-4 justify-end"
-            background
-            layout="prev, pager, next"
-            :total="state.total"
-            :page-size="query.pageSize"
-            @current-change="changePage"
-          />
-        </div>
-      </div>
-    </el-dialog>
-
-    <DialogEditRecommendGood
-      v-model:show="state.visibleEditRecommendGood"
-      @success="getList()"
-      :configId="props.id"
-      :id="rowData.id"
-    ></DialogEditRecommendGood>
-  </div>
-</template>
-<script lang="ts" setup>
-import { ref, computed, defineProps, defineEmits, watch, reactive } from "vue";
-import { Plus, Delete } from "@element-plus/icons-vue";
-import DialogEditRecommendGood from "./DialogEditRecommendGood.vue";
-import { request } from "@/utils";
-import { ElMessage } from "element-plus";
-
-const props = defineProps({
-  show: {
-    type: Boolean,
-    default: false
-  },
-  id: {
-    default: undefined
-  }
-});
-const emits = defineEmits(["update:show"]);
-const dialogVisible = computed({
-  get() {
-    return props.show;
-  },
-  set(n) {
-    emits("update:show", n);
-  }
-});
-
-watch(
-  () => dialogVisible.value,
-  n => {
-    if (n) {
-      getList();
-    } else {
-    }
-  }
-);
-const state = reactive({
-  tableData: [],
-  total: 0,
-  visibleEditRecommendGood: false,
-  multipleSelection: [] // 选中项
-});
-const rowData = ref({});
-const query = ref({
-  page: 1,
-  pageSize: 15
-});
-const changePage = page => {
-  query.value.page = page;
-  getList();
-};
-const getList = () => {
-  if (!props.id) return;
-  request
-    .get("/mallService/mechanism/indexConfigs/goods", {
-      params: {
-        configId: props.id,
-        ...query.value
-      }
-    })
-    .then(resp => {
-      state.tableData = resp.data.list;
-      state.total = resp.data.total;
-    });
-};
-const handleAdd = () => {
-  rowData.value = {};
-  state.visibleEditRecommendGood = true;
-};
-
-const handleEdit = row => {
-  rowData.value = row;
-  state.visibleEditRecommendGood = true;
-};
-
-// 选中之后的change方法,一旦选项有变化,就会触发该方法。
-const handleSelectionChange = val => {
-  state.multipleSelection = val;
-};
-const handleDelete = ids => {
-  let params = [];
-  if (!ids) {
-    params = state.multipleSelection.map(i => i.carouselId);
-  } else {
-    params = ids;
-  }
-  if (!params.length) {
-    ElMessage.error("请选择项");
-    return;
-  }
-  request
-    .post("/mallService/mechanism/indexConfigs/goods/delete", {
-      ids: params
-    })
-    .then(() => {
-      ElMessage.success("删除成功");
-      getList();
-    });
-};
-</script>

+ 0 - 135
src/views/myShop/components/DialogSecondaryCategory.vue

@@ -1,135 +0,0 @@
-<template>
-  <div>
-    <el-dialog title="新增二级类目" v-model="dialogVisible">
-      <div>
-        <el-button type="primary" @click="handleAdd" class="mb-3"
-          >新增二级类目</el-button
-        >
-        <el-table
-          ref="multipleTable"
-          :data="state.list"
-          tooltip-effect="dark"
-          style="width: 100%"
-        >
-          <!-- <el-table-column type="selection" width="55"> </el-table-column> -->
-          <el-table-column prop="categoryName" label="分类名称">
-          </el-table-column>
-          <el-table-column prop="categoryRank" label="排序值" width="120">
-          </el-table-column>
-          <el-table-column prop="createTime" label="添加时间" width="200">
-          </el-table-column>
-          <el-table-column label="操作" width="350">
-            <template #default="scope">
-              <el-button
-                type="primary"
-                link
-                @click="handleEdit(scope.row.categoryId)"
-                >修改</el-button
-              >
-              <el-popconfirm
-                title="确定删除吗?"
-                confirmButtonText="确定"
-                cancelButtonText="取消"
-                @confirm="handleDeleteOne(scope.row.categoryId)"
-              >
-                <template #reference>
-                  <el-button type="danger">删除</el-button>
-                </template>
-              </el-popconfirm>
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-      <template #footer>
-        <div>
-          <el-button @click="dialogVisible = false">取 消</el-button>
-          <el-button type="primary" @click="dialogVisible = false"
-            >确 定</el-button
-          >
-        </div>
-      </template>
-    </el-dialog>
-    <DialogAddCategory ref="addCate" :reload="getCategory" :type="state.type" />
-  </div>
-</template>
-<script lang="ts" setup>
-import DialogAddCategory from "./DialogAddCategory.vue";
-import { ElMessage } from "element-plus";
-
-import { ref, computed, defineProps, defineEmits, watch, reactive } from "vue";
-import { request } from "@/utils";
-
-const props = defineProps({
-  show: {
-    type: Boolean,
-    default: false
-  },
-  id: {
-    type: [Number, String]
-  }
-});
-const emits = defineEmits(["update:show"]);
-const dialogVisible = computed({
-  get() {
-    return props.show;
-  },
-  set(n) {
-    emits("update:show", n);
-  }
-});
-
-watch(
-  () => dialogVisible.value,
-  n => {
-    if (n) {
-      if (props.id) {
-        getCategory();
-      }
-    } else {
-    }
-  }
-);
-const state = reactive({
-  list: [],
-  type: "",
-  loading: false
-});
-const addCate = ref(null);
-// 修改分类
-const handleEdit = id => {
-  state.type = "edit";
-  addCate.value.open(id, true);
-};
-// 添加分类
-const handleAdd = () => {
-  state.type = "add";
-  addCate.value.open(props.id, true);
-};
-
-// 单个删除
-const handleDeleteOne = id => {
-  request
-    .delete("/mallService/mechanism/category", {
-      ids: [id]
-    })
-    .then(() => {
-      ElMessage.success("删除成功");
-      getCategory();
-    });
-};
-// 获取分类列表
-const getCategory = () => {
-  state.loading = true;
-  request
-    .get("/mallService/mechanism/category", {
-      params: {
-        pageSize: 9999,
-        parentId: props.id
-      }
-    })
-    .then(res => {
-      state.list = res.data.list;
-      state.loading = false;
-    });
-};
-</script>

+ 0 - 107
src/views/myShop/components/DialogSettingStoreStatus.vue

@@ -1,107 +0,0 @@
-<template>
-  <div>
-    <el-dialog title="设置" v-model="dialogVisible">
-      <div>
-        <el-form label-width="auto">
-          <el-form-item label="可用状态">
-            <el-radio-group
-              v-model="state.form.status"
-              class="ml-4"
-              name="status"
-            >
-              <el-radio :label="0" size="large">可用</el-radio>
-              <el-radio :label="1" size="large">禁用</el-radio>
-            </el-radio-group>
-          </el-form-item>
-          <el-form-item label="交易方式">
-            <el-radio-group v-model="state.form.tradeType" class="ml-4">
-              <el-radio :label="0" size="large">线下交易</el-radio>
-              <el-radio :label="1" size="large">线上交易</el-radio>
-              <el-radio :label="2" size="large">根据商品情况自行设定</el-radio>
-            </el-radio-group>
-          </el-form-item>
-          <el-form-item label="商品审核">
-            <el-radio-group v-model="state.form.needVerify" class="ml-4">
-              <el-radio :label="0" size="large">无需审核</el-radio>
-              <el-radio :label="1" size="large">需要审核后才能上架</el-radio>
-            </el-radio-group>
-          </el-form-item>
-        </el-form>
-      </div>
-      <template #footer>
-        <div>
-          <el-button @click="dialogVisible = false">取 消</el-button>
-          <el-button type="primary" @click="handleSubmit">确 定</el-button>
-        </div>
-      </template>
-    </el-dialog>
-  </div>
-</template>
-<script lang="ts" setup>
-import { request } from "@/utils";
-import { ElMessage } from "element-plus";
-import { ref, computed, defineProps, defineEmits, watch, reactive } from "vue";
-const props = defineProps({
-  show: {
-    type: Boolean,
-    default: false
-  },
-  id: {
-    type: Number
-  }
-});
-const emits = defineEmits(["update:show", "success"]);
-const dialogVisible = computed({
-  get() {
-    return props.show;
-  },
-  set(n) {
-    emits("update:show", n);
-  }
-});
-
-watch(
-  () => dialogVisible.value,
-  n => {
-    if (n) {
-      getDetail();
-    } else {
-    }
-  }
-);
-const status = ref(0);
-const radio1 = ref(3);
-const state = reactive({
-  detail: {},
-  form: {
-    status: 0,
-    tradeType: 0,
-    needVerify: 0
-  }
-});
-const getDetail = () => {
-  if (!props.id) {
-    return;
-  }
-  request
-    .get(`/articleService/serviceProvider/shop?id=${props.id}`)
-    .then(resp => {
-      state.detail = resp.data;
-      state.form.status = resp.data.status;
-      state.form.tradeType = resp.data.tradeType;
-      state.form.needVerify = resp.data.needVerify;
-    });
-};
-const handleSubmit = () => {
-  request
-    .post("/articleService/serviceProvider/shop/setting", {
-      id: props.id,
-      ...state.form
-    })
-    .then(resp => {
-      ElMessage.success(resp.message);
-      dialogVisible.value = false;
-      emits("success");
-    });
-};
-</script>

+ 0 - 145
src/views/myShop/components/DialogSubsidyTarget.vue

@@ -1,145 +0,0 @@
-<template>
-  <div>
-    <el-dialog title="补贴对象管理" v-model="dialogVisible">
-      <div>
-        <el-form ref="formRef" :model="form" label-width="120px">
-          <el-form-item
-            label="补贴对象名称"
-            prop="name"
-            :rules="{
-              required: true,
-              message: '请输入补贴对象名称',
-              trigger: 'blur'
-            }"
-          >
-            <div class="flex w-1/2">
-              <el-input
-                v-model="form.name"
-                placeholder="请输入补贴对象名称"
-                clearable
-              ></el-input>
-              <el-button class="ml-4" type="primary" @click="handleAdd"
-                >添加</el-button
-              >
-            </div>
-          </el-form-item>
-        </el-form>
-
-        <el-table :data="list" style="width: 100%" class="mt-6">
-          <el-table-column prop="name" label="补贴对象名称" width="width">
-            <template #default="{ row }">
-              <el-input
-                v-model="row.name"
-                placeholder="请输入补贴对象名称"
-                clearable
-                @blur="handleChangeName(row)"
-              ></el-input>
-            </template>
-          </el-table-column>
-          <el-table-column prop="name" label="操作" width="100">
-            <template #default="{ row }">
-              <el-popconfirm
-                title="确定要删除吗?"
-                @confirm="handleDelete(row.id)"
-              >
-                <template #reference>
-                  <el-button type="danger">删除</el-button>
-                </template>
-              </el-popconfirm>
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-      <template #footer>
-        <div>
-          <el-button @click="dialogVisible = false">取 消</el-button>
-          <!-- <el-button type="primary" @click="dialogVisible = false"
-            >确 定</el-button
-          > -->
-        </div>
-      </template>
-    </el-dialog>
-  </div>
-</template>
-<script lang="ts" setup>
-import { request } from "@/utils";
-import { ElMessage } from "element-plus";
-import { ref, computed, defineProps, defineEmits, watch, reactive } from "vue";
-const props = defineProps({
-  show: {
-    type: Boolean,
-    default: false
-  }
-});
-const emits = defineEmits(["update:show", "success"]);
-const dialogVisible = computed({
-  get() {
-    return props.show;
-  },
-  set(n) {
-    emits("update:show", n);
-  }
-});
-
-watch(
-  () => dialogVisible.value,
-  n => {
-    if (n) {
-      getList();
-    } else {
-      resetForm();
-    }
-  }
-);
-
-const form = reactive({
-  name: ""
-});
-const list = ref([]);
-
-const formRef = ref();
-const handleAdd = () => {
-  formRef.value.validate(valid => {
-    if (!valid) return;
-    request.post("mallService/mechanism/subsidy/target", form).then(resp => {
-      form.name = "";
-      ElMessage.success(resp.message);
-      getList();
-    });
-  });
-};
-const handleChangeName = row => {
-  if (!row.name) {
-    return ElMessage.error("补贴对象名称不能为空");
-  }
-  request
-    .post("mallService/mechanism/subsidy/target/update", {
-      id: row.id,
-      name: row.name
-    })
-    .then(resp => {
-      ElMessage.success(resp.message);
-      getList();
-    });
-};
-
-const handleDelete = id => {
-  request
-    .post("mallService/mechanism/subsidy/target/delete", {
-      id
-    })
-    .then(resp => {
-      ElMessage.success(resp.message);
-      getList();
-    });
-};
-
-const getList = () => {
-  request.get("mallService/mechanism/subsidy/targets").then(resp => {
-    list.value = resp.data;
-  });
-};
-const resetForm = () => {
-  formRef.value.resetFields();
-};
-</script>

+ 0 - 100
src/views/myShop/components/TradNote.vue

@@ -1,100 +0,0 @@
-<template>
-  <div>
-    <!-- v-if="[4, 7].includes(state.data.orderStatus)" -->
-    <el-card title="交易备注" class="mt-6">
-      <template #header>
-        <div class="flex justify-between">
-          <span>交易备注</span>
-          <el-button plain @click="onSaveComment">保存</el-button>
-        </div>
-      </template>
-      <div>
-        <el-input
-          v-model="state.data.comment"
-          type="textarea"
-          :rows="5"
-          placeholder="请输入交易备注"
-          clearable
-        />
-        <div class="mt-4">
-          <div class="mb-4">上传交易图片</div>
-          <UploadOnlyImage
-            v-model:url="state.images"
-            :key="coverKey"
-            :limit="3"
-            type="image"
-          />
-        </div>
-      </div>
-    </el-card>
-  </div>
-</template>
-<script  setup>
-import { onMounted, reactive, ref, defineProps, watch, defineEmits } from "vue";
-import { request } from "@/utils/index";
-import UploadImage from "@/components/UploadImage.vue";
-import UploadOnlyImage from "@/components/UploadOnlyImage.vue";
-import { ElMessage } from "element-plus";
-const props = defineProps({
-  id: {
-    type: [Number, String],
-    default: ""
-  }
-});
-const emits = defineEmits(["onSave"]);
-
-const state = reactive({
-  data: {},
-  tableData: [],
-  images: []
-});
-
-const onSaveComment = () => {
-  if (!state.data.comment) {
-    return ElMessage.error("请输入备注");
-  }
-  if (state.images?.length < 3) {
-    return ElMessage.error("至少上传3张交易图片");
-  }
-  emits("onSave");
-  request
-    .put("/mallService/mechanism/orders/comment", {
-      ids: [state.data.orderId],
-      comment: state.data.comment,
-      images: state.images?.map(v => v.url)
-    })
-    .then(resp => {
-      // ElMessage.success(resp.message);
-      getOrderDetail();
-    });
-};
-const getOrderDetail = () => {
-  request.get(`/mallService/mechanism/orders/${props.id}`).then(res => {
-    state.data = res.data;
-    state.images = res.data.images?.map((v, i) => {
-      return {
-        url: v,
-        name: "images" + i,
-        status: "success",
-        uid: new Date().getTime()
-      };
-    });
-    if (!state.images) {
-      state.images = [];
-    }
-  });
-};
-
-watch(
-  () => props.id,
-  n => {
-    if (n) {
-      getOrderDetail();
-    }
-  },
-  {
-    deep: true,
-    immediate: true
-  }
-);
-</script>

+ 0 - 52
src/views/myShop/purchaseNotice.vue

@@ -1,52 +0,0 @@
-<template>
-  <div>
-    <Editor v-model:value="purchaseNotice" className="h-[70vh]" />
-    <div class="flex items-center justify-end mt-4">
-      <el-button @click="clearPurchaseNotice">清空内容</el-button>
-      <el-button type="primary" @click="savePurchaseNotice">保存</el-button>
-    </div>
-  </div>
-</template>
-<script setup>
-import { ref } from "vue";
-import { request } from "@/utils";
-import Editor from "@/components/Editor.vue";
-import { ElMessage, ElMessageBox} from 'element-plus';
-
-import { useUserStoreHook } from "@/store/modules/user";
-const mechanismId = useUserStoreHook()?.profile.id;
-const purchaseNotice = ref("");
-const getPurchaseNotice = async () => {
-  const { data } = await request.get(
-    `/articleService/open/serviceProvider/purchaseNotice`,
-    {
-      params: {
-        mechanismId
-      }
-    }
-  );
-  purchaseNotice.value = data.notice || "";
-};
-getPurchaseNotice();
-
-const savePurchaseNotice = async () => {
-  await request.post(`/articleService/serviceProvider/purchaseNotice`, {
-    mechanismId,
-    notice:
-      purchaseNotice.value == "<p><br></p>" ? "" : purchaseNotice.value
-  });
-  ElMessage.success("保存成功");
-};
-const clearPurchaseNotice = async () => {
-  await ElMessageBox.confirm(`确定要清空内容吗?`, "提示", {
-    type: "warning"
-  });
-  await request.post(`/articleService/serviceProvider/purchaseNotice`, {
-    mechanismId,
-    notice: ""
-  });
-  ElMessage.success("清空成功");
-};
-</script>
-
-<style lang="scss" scoped></style>

+ 0 - 92
src/views/physical/Components/Assess.vue

@@ -1,92 +0,0 @@
-<template>
-  <div v-if="item" class="logic-assess-item">
-    <div
-      v-if="item.status"
-      class="logic-assess-status"
-      :style="{
-        background: item.color
-      }"
-    >
-      {{ item.status || '未知' }}
-    </div>
-    <div class="logic-assess-title">
-      <i
-        :style="{
-          background: item.color || '#ccc'
-        }"
-      />
-      <span>{{ item.title }}</span>
-    </div>
-    <div class="logic-assess-tips">
-      <div class="logic-assess-tip" v-for="(item, index) in item.tips" :key="index">· {{ item }}</div>
-    </div>
-    <div class="logic-assess-factors">评估要素:{{ item.factors.join('、') }}</div>
-  </div>
-</template>
-<script>
-export default {
-  data() {
-    return {}
-  },
-  props: {
-    item: {
-      type: Object,
-      default: () => {}
-    }
-  }
-}
-</script>
-<style lang="scss" scoped>
-.logic-assess-item {
-  position: relative;
-  border-radius: 8px;
-  overflow: hidden;
-  background: #fff;
-  padding: 10px;
-  .logic-assess-status {
-    position: absolute;
-    top: 0;
-    right: 0;
-    padding: 6px 15px;
-    color: #fff;
-    background-color: #ccc;
-    border-radius: 0 8px 0 8px;
-  }
-  .logic-assess-title {
-    vertical-align: middle;
-    font-size: 18px;
-    font-weight: bold;
-    color: #333;
-    i,
-    span {
-      vertical-align: middle;
-    }
-    i {
-      display: inline-block;
-      width: 4px;
-      border-radius: 4px;
-      height: 14px;
-      margin-right: 8px;
-    }
-  }
-  .logic-assess-tips {
-    background: #f5f6f8;
-    border-radius: 4px;
-    padding: 15px;
-    margin: 15px 0;
-    .logic-assess-tip {
-      color: #595959;
-      line-height: 26px;
-      font-size: 14px;
-      & ~ .logic-assess-tip {
-        margin-top: 10px;
-      }
-    }
-  }
-  .logic-assess-factors {
-    color: #808080;
-    font-size: 14px;
-    margin: 10px auto;
-  }
-}
-</style>

+ 0 - 210
src/views/physical/Components/DialogSurvey.vue

@@ -1,210 +0,0 @@
-<template>
-  <div class="component-dialog-survey">
-    <el-dialog
-      v-model="visible"
-      v-cloak
-      width="70%"
-      :close-on-press-escape="false"
-      :close-on-click-modal="false"
-    >
-      <template #title>
-        <span>问卷名称: {{ answerDetail?.surveyMechanism?.name || "" }}</span>
-        <!-- <span class="margin-left-10" style="color: #666; font-size: 14px"
-          >(注意:标<span style="color: #f56c6c">*</span>的为必答题)</span
-        > -->
-      </template>
-      <!-- style="height: 50vh; overflow: scroll" -->
-      <div>
-        <Questions
-          ref="questions"
-          :details="details"
-          :answerResult="answerResult"
-        ></Questions>
-      </div>
-      <template #footer>
-        <el-button @click="visible = false">取 消</el-button>
-        <el-button @click="handleSave">保存</el-button>
-
-        <el-button type="primary" @click="handleSubmit('submit')"
-          >提 交</el-button
-        >
-      </template>
-    </el-dialog>
-  </div>
-</template>
-<script>
-import Questions from "../surveyCmps/Questions.vue";
-import { request, uploadToOSS } from "@/utils";
-import { ElMessage } from "element-plus";
-
-export default {
-  components: {
-    Questions
-  },
-  data() {
-    return {
-      details: {},
-      survey: {},
-      answerResult: {},
-      answerDetail: {},
-      QUESTION_TYPE_TEMP_CHECK: "temp_check",
-      QUESTION_TYPE_ANSWER: "answer",
-      QUESTION_TYPE_INPUT: "input",
-      QUESTION_TYPE_TEXT: "text",
-      QUESTION_TYPE_CHECKBOX: "checkbox",
-      QUESTION_TYPE_RADIO: "radio",
-      QUESTION_TYPE_RATING_SCALE: "rating_scale",
-      QUESTION_TYPE_RATING: "rating",
-      QUESTION_TYPE_DATE: "date",
-      QUESTION_TYPE_MATRIX: "matrix_checkbox",
-      QUESTION_TYPE_COMBINATION: "group"
-    };
-  },
-  computed: {
-    visible: {
-      get() {
-        return this.show;
-      },
-      set(n) {
-        this.$emit("update:show", n);
-      }
-    }
-  },
-  props: {
-    show: Boolean,
-    id: [Number, String],
-    resultId: [Number, String]
-  },
-  watch: {
-    show(n) {
-      if (n) {
-        // Elmessage.success(resp.message);
-        this.getResultDetails();
-        this.getDetails();
-      }
-    }
-  },
-  methods: {
-    getResultDetails() {
-      request
-        .get("/surveyService/mechanism/surveyResult/detail", {
-          params: {
-            id: this.resultId
-          }
-        })
-        .then(resp => {
-          console.log("获取的问卷结果详情", resp);
-          this.answerResult = resp.data.detail.answerResult;
-          this.answerDetail = resp.data.detail;
-        });
-    },
-    getDetails() {
-      if (!this.id) return;
-      return new Promise(resolve => {
-        request
-          .get("/surveyService/mechanism/survey/detail/config", {
-            params: {
-              id: this.id
-            }
-          })
-          .then(resp => {
-            let details = resp.data.detail;
-            details.questions = details.subjects.map(v => {
-              try {
-                return JSON.parse(v.questionnaireSubject.validator);
-              } catch (error) {
-                return { ...v, ...v.questionnaireSubject };
-              }
-            });
-            this.details = details;
-            console.log(this.details);
-            this.survey = resp.data.subjects;
-            setTimeout(() => {
-              this.$refs["questions"].init();
-            }, 500);
-          });
-      });
-    },
-    handleSave() {
-      this.handleSubmit("cache");
-    },
-    handleSubmit(key = "submit") {
-      let { surveyInfo, questions, isAllAnswer } =
-        this.$refs["questions"].handleSubmit();
-      //   if (!isAllAnswer) {
-      //     return this.$message.error('请回答完所属问卷')
-      //   }
-      this.visible = false;
-      let requestAnswer = this.formatAnswer(questions);
-      console.log(requestAnswer);
-      let api = {
-        cache: "/surveyService/mechanism/surveyResult/save",
-        submit: "/surveyService/mechanism/surveyResult/submit"
-      };
-      console.log(api[key]);
-      request
-        .post(api[key], {
-          id: this.resultId,
-          answer: requestAnswer
-        })
-        .then(resp => {
-          this.$message.success("操作成功");
-          this.$emit("success");
-        });
-    },
-    formatAnswer(questions) {
-      let answerList = questions.filter(v => v.code);
-      let answerObj = {};
-      answerList.map(v => {
-        let obj = {};
-        switch (v.type) {
-          case this.QUESTION_TYPE_MATRIX:
-            obj["matrixAnswers"] = v.matrixValue;
-            break;
-
-          case this.QUESTION_TYPE_INPUT:
-            obj["inputAnswers"] = {
-              key: v.qKey,
-              value: [v.answer]
-            };
-            break;
-
-          case this.QUESTION_TYPE_DATE:
-            obj["answer"] = {
-              key: v.qKey,
-              value: v.rawAnswer
-            };
-            break;
-
-          case this.QUESTION_TYPE_CHECKBOX:
-            obj["checkboxAnswers"] = v.rawAnswer;
-            break;
-          case this.QUESTION_TYPE_RADIO:
-            obj["answer"] = v.rawAnswer;
-            break;
-          case this.QUESTION_TYPE_COMBINATION:
-            obj["groupAnswers"] = v.rawAnswer;
-        }
-        answerObj[v.code] = {
-          type: v.type,
-          questionNo: v.code,
-          multipleAnswers: v.multipleAnswers,
-          ...obj
-        };
-      });
-      return answerObj;
-    }
-  }
-};
-</script>
-<style lang="scss" scoped>
-[v-cloak] {
-  display: none;
-}
-.component-dialog-survey {
-  ::v-deep .el-dialog__body {
-    height: 70vh;
-    overflow: scroll;
-  }
-}
-</style>

+ 0 - 206
src/views/physical/Components/DialogViewSurveyResult.vue

@@ -1,206 +0,0 @@
-<template>
-  <div>
-    <el-dialog
-      :title="`查看问卷结果: ${props.rowData?.surveyMechanism?.name}(ID: ${props.rowData?.surveyMechanism?.id})`"
-      v-model="visible"
-    >
-      <div class="page-logic-result">
-        <div class="p-2 text-sm">
-          <div v-for="(item, index) in state.surveyResultData" :key="index">
-            <!-- <div>{{ item }}</div> -->
-            <Component :is="comps[item.type]" :item="item" class="mb-2" />
-          </div>
-        </div>
-      </div>
-    </el-dialog>
-  </div>
-</template>
-<script setup>
-import { request, msToDate, parseJsonData } from "@/utils";
-import {
-  computed,
-  onMounted,
-  reactive,
-  ref,
-  defineProps,
-  defineEmits,
-  watch
-} from "vue";
-import { useRoute, useRouter } from "vue-router";
-import Text from "@/components/Survey/Text.vue";
-import TitleAndContents from "@/components/Survey/TitleAndContents.vue";
-import RichText from "@/components/Survey/RichText.vue";
-
-const route = useRoute();
-const router = useRouter();
-const key = ref(Date.now());
-const emits = defineEmits(["update:show"]);
-const props = defineProps({
-  rowData: {
-    type: Object,
-    default: () => {}
-  },
-  show: Boolean
-});
-watch(
-  () => props.show,
-  (n, o) => {
-    if (n) {
-      console.log("监听成功");
-      init();
-    }
-  }
-);
-const comps = {
-  text: Text,
-  titleAndContents: TitleAndContents,
-  richText: RichText
-};
-const visible = computed({
-  get() {
-    return props.show;
-  },
-  set(n) {
-    emits("update:show", n);
-  }
-});
-
-const areaSelectRef = ref();
-const state = reactive({
-  detail: {
-    id: "",
-    title: "",
-    needPassword: false,
-    canSaveArchives: ""
-  },
-
-  surveyResultData: []
-});
-
-let repeatCount = 0;
-const init = async () => {
-  const { data } = await request.get(
-    "/surveyService/mechanism/surveyResult/detail",
-    {
-      params: {
-        id: props.rowData.id
-      }
-    }
-  );
-  console.log(data);
-  if (!data.detail.resultRaw && repeatCount <= 5) {
-    repeatCount++;
-    setTimeout(() => {
-      init();
-    }, 5e2 * 2 ** repeatCount);
-    return;
-  }
-  state.surveyResultData =
-    parseJsonData(data.detail.resultRaw, {}).result?.surveyResultData || [];
-  key.value = Date.now();
-  console.log(state.surveyResultData);
-};
-// init();
-const reset = () => {
-  router.replace({
-    name: "decisionQuestion",
-    query: {
-      id: route.query.surveyMechanismId,
-      _r: Date.now()
-    }
-  });
-};
-</script>
-<style lang="scss" scoped>
-.block {
-  display: block;
-  box-shadow: 0 0 2px #ddd;
-  margin: 10px 0;
-  box-sizing: border-box;
-  padding: 10px;
-  overflow: hidden;
-  &.primary {
-    background: #fefaeb;
-  }
-}
-.block-title {
-  font-size: 16px;
-  color: #903128;
-}
-.block-tag {
-  display: inline-block;
-  background: #fcfcf9;
-  border-radius: 4px;
-  border: 1px solid #eeeeee;
-  padding: 8px 15px;
-  margin: 0 6px 6px 0;
-}
-.dot-item {
-  padding-left: 16px;
-  box-sizing: border-box;
-  position: relative;
-  font-size: 14px;
-  color: #999;
-  line-height: 1.8;
-  margin-bottom: 10px;
-  word-break: break-all;
-  &::before {
-    content: "";
-    position: absolute;
-    top: 8px;
-    left: 4px;
-    width: 8px;
-    height: 8px;
-    border-radius: 50%;
-    background: #903128;
-  }
-}
-.block-table {
-  border-collapse: collapse;
-  margin: 10px 0;
-  width: 100%;
-  tbody {
-    width: 100%;
-  }
-  th {
-    color: #903128;
-    line-height: 40px;
-    background: #f3eae0;
-  }
-  td {
-    color: #888;
-    width: 60%;
-  }
-  th:not(:last-of-type),
-  td:not(:last-of-type) {
-    border-right: 1px solid #eee;
-    text-align: center;
-  }
-  td:not(:last-of-type) {
-    color: #333;
-    width: 40%;
-  }
-  tr:nth-child(even) {
-    background: #fcfcf9;
-  }
-  tr:nth-child(odd) {
-    background: #f4f0e1;
-  }
-  td {
-    padding: 10px;
-  }
-}
-.block-grid {
-  display: grid;
-  grid-template-columns: 1fr 1fr;
-  grid-template-rows: 1fr 1fr;
-}
-.charts-style {
-  width: 100%;
-  height: 360px;
-}
-.exponent-item {
-  display: flex;
-  align-items: center;
-}
-</style>

+ 0 - 144
src/views/physical/Components/EditArchivesModal.vue

@@ -1,144 +0,0 @@
-<template>
-  <div>
-    <el-dialog title="修改关联档案" v-model="dialogVisible">
-      <div>
-        <el-form ref="formRef" :model="form" label-width="120px" status-icon>
-          <el-form-item label="问卷结果编号:">
-            <el-text tag="b">{{ props?.rowData.id }}</el-text>
-          </el-form-item>
-          <el-form-item label="问卷结果名称:">
-            <el-text tag="b">{{ props?.rowData?.survey?.name || "-" }}</el-text>
-          </el-form-item>
-          <el-form-item
-            label="关联的档案:"
-            prop="archivesId"
-            :rules="[
-              {
-                required: true,
-                message: '请输入档案号或者姓名',
-                trigger: 'blur'
-              }
-            ]"
-          >
-            <el-select
-              v-model="form.archivesId"
-              style="width: 30%"
-              placeholder="输入档案编号或姓名进行查找"
-            >
-              <el-option
-                v-for="item in archivesList"
-                :key="item.id"
-                :label="item.label"
-                :value="item.id"
-              >
-              </el-option>
-            </el-select>
-          </el-form-item>
-        </el-form>
-      </div>
-      <template #footer>
-        <div class="">
-          <el-button @click="dialogVisible = false">取 消</el-button>
-          <el-button type="primary" @click="onNext">确 认</el-button>
-        </div>
-      </template>
-    </el-dialog>
-    <ComponentDialogSurvey
-      v-model:show="visibleAnswerSurvey"
-    ></ComponentDialogSurvey>
-  </div>
-</template>
-<script lang="ts" setup>
-import { ref, computed, defineProps, defineEmits, watch } from "vue";
-import type { FormInstance, FormRules } from "element-plus";
-import { ElMessage } from "element-plus";
-
-import { request } from "@/utils/http";
-
-import ComponentDialogSurvey from "./DialogSurvey.vue";
-
-const props = defineProps({
-  show: {
-    type: Boolean,
-    default: false
-  },
-  rowData: {
-    type: Object,
-    default: () => {}
-  }
-});
-const emits = defineEmits(["update:show", "success"]);
-const dialogVisible = computed({
-  get() {
-    return props.show;
-  },
-  set(n) {
-    emits("update:show", n);
-  }
-});
-
-watch(
-  () => dialogVisible.value,
-  n => {
-    if (n) {
-      initData();
-      form.value.archivesId = props.rowData.archivesId;
-    } else {
-      resetForm();
-    }
-  }
-);
-const formRef = ref<FormInstance>();
-const form = ref({
-  surveyMechanismId: undefined, // 机构问卷编号
-  archivesId: "", // 档案编号
-  time: undefined
-});
-const visibleAnswerSurvey = ref(false);
-const archivesList = ref([]);
-/**
- * 获取档案列表
- */
-const getArchivesList = key => {
-  request
-    .get("/archivesService/mechanism/archives/paginate", {
-      params: {
-        name: key,
-        pageSize: 100
-      }
-    })
-    .then(resp => {
-      archivesList.value = resp.data.list.map(v => {
-        return {
-          ...v,
-          label: `${v.name}(${v.id})`
-        };
-      });
-    });
-};
-
-const onNext = async () => {
-  await formRef.value.validate((valid, fields) => {
-    if (!valid) return;
-    request
-      .post("/surveyService/mechanism/surveyResult/update/archivesId", {
-        archivesId: form.value.archivesId,
-        id: props.rowData.id
-      })
-      .then(resp => {
-        dialogVisible.value = false;
-        ElMessage.success(resp?.message);
-        emits("success");
-      });
-  });
-};
-
-const resetForm = () => {
-  formRef.value.resetFields();
-};
-
-const initData = () => {
-  getArchivesList();
-};
-</script>
-<style lang="scss" scoped></style>

+ 0 - 217
src/views/physical/Components/EditSurveyModal.vue

@@ -1,217 +0,0 @@
-<template>
-  <div>
-    <el-dialog title="问卷管理" v-model="dialogVisible">
-      <div>
-        <el-form
-          ref="ruleFormRef"
-          :model="ruleForm"
-          label-width="120px"
-          status-icon
-        >
-          <el-form-item
-            label="问卷名称"
-            prop="name"
-            :rules="[
-              {
-                required: true,
-                message: '请输入问卷名称',
-                trigger: 'blur'
-              }
-            ]"
-          >
-            <el-input v-model="ruleForm.name"></el-input>
-          </el-form-item>
-          <el-form-item label="问卷封面">
-            <el-upload
-              class="avatar-uploader"
-              :show-file-list="false"
-              :before-upload="beforeAvatarUpload"
-              :http-request="simpleImgHttpUpload"
-            >
-              <img v-if="ruleForm.cover" :src="ruleForm.cover" class="avatar" />
-              <el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
-            </el-upload>
-          </el-form-item>
-          <el-form-item label="问卷介绍:" prop="ruleForm.description">
-            <div class="border border-solid border-gray-200">
-              <Toolbar
-                :editor="editorRef"
-                :defaultConfig="{}"
-                mode="default"
-                class="border-b border-solid border-gray-200"
-              />
-              <div class="h-96">
-                <Editor
-                  v-model="ruleForm.description"
-                  :defaultConfig="editorConfig"
-                  mode="default"
-                  @onCreated="editorCreated"
-                />
-              </div>
-            </div>
-          </el-form-item>
-
-          <el-form-item>
-            <el-button type="primary" @click="onSubmit(ruleFormRef)"
-              >确定</el-button
-            >
-            <el-button @click="dialogVisible = false">取消</el-button>
-          </el-form-item>
-        </el-form>
-      </div>
-    </el-dialog>
-  </div>
-</template>
-<script lang="ts" setup>
-import {
-  shallowRef,
-  ref,
-  reactive,
-  computed,
-  defineProps,
-  defineEmits,
-  watch
-} from "vue";
-import type { FormInstance, FormRules } from "element-plus";
-import { ElMessage } from "element-plus";
-import { Plus } from "@element-plus/icons-vue";
-import { Editor, Toolbar } from "@wangeditor/editor-for-vue";
-import "@wangeditor/editor/dist/css/style.css"; // 引入 css
-
-import { request, uploadToOSS } from "@/utils";
-import type { UploadProps } from "element-plus";
-
-const props = defineProps({
-  show: {
-    type: Boolean,
-    default: false
-  },
-  rowData: {
-    type: Object,
-    default: () => {}
-  }
-});
-const emits = defineEmits(["update:show", "success"]);
-const ruleFormRef = ref<FormInstance>();
-const ruleForm = ref({
-  name: "",
-  cover: "",
-  description: ""
-});
-
-const editorRef = shallowRef();
-const editorCreated = editor => {
-  editorRef.value = editor;
-};
-
-const editorConfig = {
-  placeholder: '请输入内容....',
-  MENU_CONF: {
-    uploadImage: {
-      // 自定义上传
-      async customUpload(file, insertFn) {
-        console.log(file);
-        // file 即选中的文件
-        const url = await uploadToOSS(file, file.name);
-        // 最后插入图片
-        insertFn(url, 'image');
-      }
-    }
-  }
-};
-const dialogVisible = computed({
-  get() {
-    return props.show;
-  },
-  set(n) {
-    emits("update:show", n);
-  }
-});
-
-watch(
-  () => dialogVisible.value,
-  n => {
-    if (n) {
-      if (props.rowData.id) {
-        ruleForm.value.name = props.rowData.name;
-        ruleForm.value.cover = props.rowData.cover;
-        ruleForm.value.description = props.rowData?.description;
-      }
-    } else {
-    }
-  }
-);
-
-const beforeAvatarUpload: UploadProps["beforeUpload"] = rawFile => {
-  console.log(rawFile);
-
-  if (!["image/png", "image/jpeg"].includes(rawFile.type)) {
-    ElMessage.error("Avatar picture must be JPG format!");
-    return false;
-  } else if (rawFile.size / 1024 / 1024 > 2) {
-    ElMessage.error("Avatar picture size can not exceed 2MB!");
-    return false;
-  }
-  return true;
-};
-
-const simpleImgHttpUpload = options => {
-  console.log("options", options);
-  uploadToOSS(options.file, options.file.name).then(resp => {
-    ruleForm.value.cover = resp;
-  });
-};
-const onSubmit = async (formEl: FormInstance | undefined) => {
-  await formEl.validate((valid, fields) => {
-    if (!valid) return;
-    let params = ruleForm.value;
-    request
-      .post("/surveyService/mechanism/survey/update", {
-        ...params,
-        id: props.rowData.id
-      })
-      .then(resp => {
-        ElMessage.success(resp.message);
-        dialogVisible.value = false;
-        emits("success");
-      });
-  });
-};
-const onReset = () => {
-  if (!ruleFormRef.value) return;
-  ruleFormRef.value.resetFields();
-};
-</script>
-<style scoped lang="scss">
-.avatar-uploader .avatar {
-  width: 178px;
-  height: 178px;
-  display: block;
-}
-
-.ql-editor {
-  min-height: 200px;
-}
-</style>
-<style>
-.avatar-uploader .el-upload {
-  border: 1px dashed var(--el-border-color);
-  border-radius: 6px;
-  cursor: pointer;
-  position: relative;
-  overflow: hidden;
-  transition: var(--el-transition-duration-fast);
-}
-
-.avatar-uploader .el-upload:hover {
-  border-color: var(--el-color-primary);
-}
-
-.el-icon.avatar-uploader-icon {
-  font-size: 28px;
-  color: #8c939d;
-  width: 178px;
-  height: 178px;
-  text-align: center;
-}
-</style>

+ 0 - 205
src/views/physical/Components/EditSurveyResultModal.vue

@@ -1,205 +0,0 @@
-<template>
-  <div>
-    <el-dialog title="新增答题" v-model="dialogVisible">
-      <div>
-        <el-form ref="formRef" :model="form" label-width="120px" status-icon>
-          <el-form-item
-            label="选择问卷"
-            prop="surveyMechanismId"
-            :rules="[
-              {
-                required: true,
-                message: '请选择问卷',
-                trigger: 'blur'
-              }
-            ]"
-          >
-            <el-select
-              style="width: 30%"
-              v-model="form.surveyMechanismId"
-              placeholder="选择问卷"
-              clearable
-            >
-              <el-option
-                v-for="item in surveyList"
-                :key="item.id"
-                :label="item.label"
-                :value="item.id"
-              >
-              </el-option>
-            </el-select>
-          </el-form-item>
-          <el-form-item
-            label="选择用户"
-            prop="archivesId"
-            :rules="[
-              {
-                required: true,
-                message: '请选择用户',
-                trigger: 'blur'
-              }
-            ]"
-          >
-            <el-select
-              v-model="form.archivesId"
-              style="width: 30%"
-              placeholder="输入档案编号或姓名进行查找"
-            >
-              <el-option
-                v-for="item in archivesList"
-                :key="item.id"
-                :label="item.label"
-                :value="item.id"
-              >
-              </el-option>
-            </el-select>
-          </el-form-item>
-          <el-form-item
-            label="答题时间"
-            prop="time"
-            :rules="[
-              {
-                required: true,
-                message: '请选择答题时间',
-                trigger: 'blur'
-              }
-            ]"
-          >
-            <el-col :span="11">
-              <el-date-picker
-                value-format="YYYY-MM-DD HH:mm:ss"
-                v-model="form.time"
-                type="datetimerange"
-                range-separator="—"
-                start-placeholder="答题开始时间"
-                end-placeholder="答题结束时间"
-              />
-            </el-col>
-          </el-form-item>
-        </el-form>
-      </div>
-      <template #footer>
-        <div>
-          <el-button @click="dialogVisible = false">取 消</el-button>
-          <el-button type="primary" @click="onNext">下一步</el-button>
-        </div>
-      </template>
-    </el-dialog>
-    <ComponentDialogSurvey
-      v-model:show="visibleAnswerSurvey"
-      :id="surveyConfig.surveyMechanismId"
-      :resultId="surveyConfig.id"
-    ></ComponentDialogSurvey>
-  </div>
-</template>
-<script lang="ts" setup>
-import { ref, computed, defineProps, defineEmits, watch } from "vue";
-import type { FormInstance, FormRules } from "element-plus";
-import { request } from "@/utils/http";
-import ComponentDialogSurvey from "./DialogSurvey.vue";
-
-const props = defineProps({
-  show: {
-    type: Boolean,
-    default: false
-  }
-});
-const emits = defineEmits(["update:show"]);
-const dialogVisible = computed({
-  get() {
-    return props.show;
-  },
-  set(n) {
-    emits("update:show", n);
-  }
-});
-
-watch(
-  () => dialogVisible.value,
-  n => {
-    if (n) {
-      initData();
-    } else {
-      resetForm();
-    }
-  }
-);
-const formRef = ref<FormInstance>();
-const form = ref({
-  surveyMechanismId: undefined, // 机构问卷编号
-  archivesId: "", // 档案编号
-  time: undefined
-});
-const visibleAnswerSurvey = ref(false);
-const surveyList = ref([]);
-const surveyConfig = ref({});
-const archivesList = ref([]);
-/**
- * 获取问卷列表
- */
-const getSurveyList = () => {
-  request
-    .get("/surveyService/mechanism/survey/paginate", {
-      params: {
-        key: undefined,
-        pageSize: 999
-      }
-    })
-    .then(resp => {
-      surveyList.value = resp.data.list.map(v => {
-        return {
-          ...v,
-          label: `${v.name}(${v.surveyId})`
-        };
-      });
-    });
-};
-/**
- * 获取档案列表
- */
-const getArchivesList = key => {
-  request
-    .get("/archivesService/mechanism/archives/paginate", {
-      params: {
-        name: key,
-        pageSize: 100
-      }
-    })
-    .then(resp => {
-      archivesList.value = resp.data.list.map(v => {
-        return {
-          ...v,
-          label: `${v.name}(${v.id})`
-        };
-      });
-    });
-};
-const onNext = async () => {
-  await formRef.value.validate((valid, fields) => {
-    if (!valid) return;
-    let [startTime, endTime] = form.value.time;
-    request
-      .post("/surveyService/mechanism/surveyResult/create", {
-        archivesId: form.value.archivesId,
-        surveyMechanismId: form.value.surveyMechanismId,
-        startTime,
-        endTime
-      })
-      .then(resp => {
-        dialogVisible.value = false;
-        visibleAnswerSurvey.value = true;
-        surveyConfig.value = resp.data.detail;
-      });
-  });
-};
-
-const resetForm = () => {
-  formRef.value.resetFields();
-};
-
-const initData = () => {
-  getSurveyList();
-  getArchivesList();
-};
-</script>
-<style lang="scss" scoped></style>

+ 0 - 125
src/views/physical/Components/UserInfo.vue

@@ -1,125 +0,0 @@
-<template>
-  <div v-if="item" class="logic-user-item">
-    <div class="logic-user-info">
-      <div>
-        <div class="name">{{ item.name }}</div>
-        <div class="flex-center-v">
-          <div class="flex-center-v tag">
-            <img
-              :src="
-                require(`@/assets/icon-gender-${
-                  item.gender == '男' ? 1 : 2
-                }.png`)
-              "
-              alt=""
-            />
-            <span>{{ item.gender }}</span>
-          </div>
-          <div class="flex-center-v tag">
-            <img :src="iconAge" alt="" />
-            <span>{{ item.age }}</span>
-          </div>
-        </div>
-      </div>
-    </div>
-    <div class="logic-user-tips">
-      {{ item.tips }}
-    </div>
-  </div>
-</template>
-<script>
-import iconAge from "@/assets/icon-age.png";
-export default {
-  data() {
-    return {
-      iconAge
-    };
-  },
-  props: {
-    item: {
-      type: Object,
-      default: () => ({
-        gender: "",
-        age: 0
-      })
-    }
-  }
-};
-// import { computed, defineProps, PropType } from 'vue'
-// import { msToDate } from '@/utils/index'
-// interface userInfo {
-//   age: number
-//   gender: string
-//   name: string
-//   photo: string
-//   tips: string
-// }
-// const props = defineProps({
-//   item: {
-//     type: Object as PropType<userInfo>
-//   }
-// })
-// const gender = computed(() => (props.item?.gender == '男' ? 1 : 2))
-// const birthday = computed(() => {
-//   let d = new Date()
-//   d.setFullYear(d.getFullYear() - (props.item?.age || 0))
-//   return msToDate(d, '')
-// })
-</script>
-<style lang="scss" scoped>
-.logic-user-item {
-  position: relative;
-  border-radius: 8px;
-  overflow: hidden;
-  background: #fff;
-  padding: 10px;
-  .logic-user-info {
-    // padding: 20px 10px 0;
-    padding-top: 10px;
-    color: #333;
-    // background: #3e70fb;
-    display: flex;
-    justify-content: flex-start;
-    align-items: center;
-    .avatar {
-      width: 52px;
-      height: 52px;
-      margin-right: 15px;
-      margin-left: 15px;
-    }
-    .name {
-      font-size: 16px;
-      font-weight: bold;
-      margin-bottom: 8px;
-    }
-    .age {
-      color: #4d4d4d;
-      // margin-left: 10px;
-      font-size: 14px;
-    }
-    .tag {
-      display: inline-block;
-      color: #3e70fb;
-      background: #eef1fc;
-      border-radius: 4px;
-      padding: 0 12px;
-      margin-right: 10px;
-      height: 26px;
-      line-height: 26px;
-      img {
-        height: 0.8em;
-        margin-right: 6px;
-      }
-    }
-  }
-  .logic-user-tips {
-    color: #333;
-    background: #f5f7ff;
-    padding: 10px;
-    font-size: 15px;
-    word-wrap: break-all;
-    margin: 10px 0;
-    line-height: 26px;
-  }
-}
-</style>

+ 0 - 23
src/views/physical/index.vue

@@ -1,23 +0,0 @@
-<template >
-  <div>
-    <el-tabs type="card">
-      <el-tab-pane label="定制体检结果" name="0">
-        <Result></Result>
-
-      </el-tab-pane>
-      <el-tab-pane label="定制体检问卷管理" name="1">
-        <Survey></Survey>
-      </el-tab-pane>
-
-    </el-tabs>
-  </div>
-</template>
-<script setup>
-import Result from './result.vue';
-import Survey from './survey.vue';
-</script>
-<style lang="scss">
-.el-tabs__item {
-  background: #fff;
-}
-</style>

+ 0 - 327
src/views/physical/result.vue

@@ -1,327 +0,0 @@
-<template>
-  <div>
-    <el-card class="box-card" shadow="never">
-      <el-row>
-        <el-col :span="12">
-          <el-button
-            type="primary"
-            @click="
-              () => {
-                rowData = {};
-                visibleEditSurveyResult = true;
-              }
-            "
-            >新增定制体检</el-button
-          >
-        </el-col>
-        <el-col :span="12" class="flex">
-          <el-select
-            class="w-100"
-            v-model="query.method"
-            placeholder="答题方式"
-          >
-            <el-option
-              v-for="item in addTypeOptions"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value"
-            >
-            </el-option>
-          </el-select>
-          <el-select
-            class="ml-2"
-            v-model="query.surveyId"
-            placeholder="选择问卷"
-            clearable
-          >
-            <el-option
-              v-for="item in surveyList"
-              :key="item.id"
-              :label="item.label"
-              :value="item.id"
-            >
-            </el-option>
-          </el-select>
-          <el-input
-            class="ml-2"
-            v-model="query.key"
-            placeholder="请输入答题人档案ID"
-            clearable
-          />
-          <el-button
-            class="ml-2"
-            type="primary"
-            :icon="Search"
-            @click="onSearch"
-            :loading="loading"
-            >查询</el-button
-          >
-        </el-col>
-      </el-row>
-    </el-card>
-    <div class="mt-4">
-      <el-table :data="tableData" style="width: 100%">
-        <el-table-column prop="id" label="问卷结果编号" />
-
-        <el-table-column prop="nickname" label="问卷信息">
-          <template #default="scope">
-            <div class="flex items-center">
-              <el-text tag="b">编号: </el-text>
-              <el-text>{{ scope.row.surveyMechanismId }}</el-text>
-              <ComponentCopy
-                :content="scope.row.surveyMechanismId"
-              ></ComponentCopy>
-            </div>
-            <div class="mt-2">
-              <el-text tag="b">名称: </el-text>
-              <el-text>{{ scope.row.surveyMechanism.name }}</el-text>
-            </div>
-          </template>
-        </el-table-column>
-        <el-table-column prop="status" label="状态">
-          <template #default="scope">
-            <el-tag v-if="scope.row.status == 3" class="ml-2" type="success"
-              >已完成</el-tag
-            >
-            <el-tag
-              v-else-if="scope.row.status == 1"
-              class="ml-2"
-              type="primary"
-              >填写中</el-tag
-            >
-            <el-tag v-else class="ml-2" type="danger">待处理</el-tag>
-          </template>
-        </el-table-column>
-        <el-table-column prop="roles" label="答题方式">
-          <template #default="{ row }">
-            <div></div>
-            <el-text>{{ addTypeOptions[row.method].label }}</el-text>
-          </template>
-        </el-table-column>
-        <el-table-column prop="roles" label="开始时间">
-          <template #default="{ row }">
-            <el-text>{{ row.startTime }}</el-text>
-          </template>
-        </el-table-column>
-        <el-table-column prop="roles" label="结束时间">
-          <template #default="{ row }">
-            <el-text>{{ row.endTime }}</el-text>
-          </template>
-        </el-table-column>
-        <el-table-column prop="roles" label="问卷耗时">
-          <template #default="{ row }">
-            <el-text>{{ getInterval(row.startTime, row.endTime) }}分钟</el-text>
-          </template>
-        </el-table-column>
-        <el-table-column prop="roles" label="答题人档案ID">
-          <template #default="{ row }">
-            <el-text>{{ row.archivesId }}</el-text>
-          </template>
-        </el-table-column>
-        <el-table-column prop="status" label="操作" fixed="right" width="320">
-          <template #default="scope">
-            <el-space :size="size" spacer="|">
-              <el-button
-                type="primary"
-                link
-                :disabled="scope.row.status != 3"
-                @click="
-                  () => {
-                    visibleViewResult = true;
-                    rowData = scope.row;
-                  }
-                "
-                >查看结果</el-button
-              >
-              <el-button
-                type="primary"
-                link
-                :disabled="scope.row.method == 2"
-                @click="
-                  () => {
-                    visibleEditArchives = true;
-                    rowData = scope.row;
-                  }
-                "
-                >修改答题人</el-button
-              >
-              <el-button
-                type="primary"
-                link
-                :disabled="scope.row.method == 2"
-                @click="
-                  () => {
-                    visibleAnswerSurvey = true;
-                    rowData = scope.row;
-                  }
-                "
-                >继续答题</el-button
-              >
-              <el-popconfirm
-                title="确定要删除此问卷结果吗"
-                @confirm="onDelete(scope.row.id)"
-              >
-                <template #reference>
-                  <el-link type="danger" :disabled="scope.row.method == 2"
-                    >删除</el-link
-                  >
-                </template>
-              </el-popconfirm>
-            </el-space>
-          </template>
-        </el-table-column>
-      </el-table>
-
-      <el-pagination
-        class="mt-4 justify-end"
-        background
-        :current-page="query.page"
-        :page-size="query.pageSize"
-        :total="total"
-        layout="total, prev, pager, next"
-        @current-change="onChangePage"
-      ></el-pagination>
-    </div>
-    <ComponentEditSurveyResultModal
-      v-model:show="visibleEditSurveyResult"
-    ></ComponentEditSurveyResultModal>
-    <ComponentDialogSurvey
-      v-model:show="visibleAnswerSurvey"
-      :id="rowData.surveyMechanismId"
-      :resultId="rowData.id"
-      @success="getList()"
-    ></ComponentDialogSurvey>
-    <ComponentEditArchivesModal
-      v-model:show="visibleEditArchives"
-      :rowData="rowData"
-      @success="getList()"
-    ></ComponentEditArchivesModal>
-
-    <ComponentDialogViewSurveyResult
-      v-model:show="visibleViewResult"
-      :rowData="rowData"
-    ></ComponentDialogViewSurveyResult>
-  </div>
-</template>
-<script lang="ts" setup>
-import { ref, onMounted, onBeforeUnmount, reactive } from "vue";
-import { Search } from "@element-plus/icons-vue";
-import { request } from "@/utils/http";
-import { getInterval } from "@/utils";
-import ComponentEditSurveyResultModal from "./Components/EditSurveyResultModal.vue";
-import ComponentDialogSurvey from "./Components/DialogSurvey.vue";
-import ComponentEditArchivesModal from "./Components/EditArchivesModal.vue";
-import ComponentDialogViewSurveyResult from "./Components/DialogViewSurveyResult.vue";
-import ComponentCopy from "@/components/Copy/index.vue";
-
-const tableData = ref([]);
-const query = ref({
-  page: 1,
-  pageSize: 10,
-  key: "",
-  method: 0,
-  surveyId: undefined
-});
-const addTypeOptions = reactive([
-  {
-    label: "全部",
-    value: 0
-  },
-  {
-    label: "机构添加",
-    value: 1
-  },
-  {
-    label: "自主答题",
-    value: 2
-  }
-]);
-const surveyList = ref([]);
-
-const loading = ref(false);
-const total = ref(0);
-const visibleEditSurveyResult = ref(false);
-const visibleEditArchives = ref(false);
-const visibleAnswerSurvey = ref(false);
-const visibleViewResult = ref(false);
-const rowData = ref({});
-
-const getList = () => {
-  loading.value = true;
-  request
-    .get("/surveyService/mechanism/surveyResult/paginate", {
-      params: query.value
-    })
-    .then(resp => {
-      tableData.value = resp.data.list;
-      total.value = resp.data.total;
-    })
-    .finally(() => {
-      loading.value = false;
-    });
-};
-/**
- * 获取问卷列表
- */
-const getSurveyList = () => {
-  request
-    .get("/surveyService/mechanism/survey/paginate", {
-      params: {
-        key: undefined,
-        pageSize: 999
-      }
-    })
-    .then(resp => {
-      surveyList.value = resp.data.list.map(v => {
-        return {
-          ...v,
-          label: `${v.name}(${v.surveyId})`
-        };
-      });
-    });
-};
-
-const onSearch = () => {
-  query.value.page = 1;
-  getList();
-};
-const onChangePage = page => {
-  query.value.page = page;
-  getList();
-};
-const handleEdit = row => {
-  rowData.value = row;
-  visibleEditSurveyResult.value = true;
-};
-
-const onDelete = id => {
-  if (!id) return;
-  request
-    .post("/surveyService/mechanism/surveyResult/delete", { id })
-    .then(resp => {
-      ElMessage.success(resp.message);
-      getList();
-    });
-};
-
-/** 使用公共函数,避免`removeEventListener`失效 */
-function onkeypress({ code }: KeyboardEvent) {
-  if (code === "Enter") {
-    onSearch();
-  }
-}
-
-onMounted(() => {
-  window.document.addEventListener("keypress", onkeypress);
-});
-
-onBeforeUnmount(() => {
-  window.document.removeEventListener("keypress", onkeypress);
-});
-
-const initData = () => {
-  getList();
-  getSurveyList();
-};
-initData();
-</script>

+ 0 - 228
src/views/physical/survey.vue

@@ -1,228 +0,0 @@
-<template>
-  <div>
-    <el-card class="box-card" shadow="never">
-      <el-row>
-        <el-col :span="12">
-          <el-button v-if="curTab == 'custom'" type="primary" @click="showAddSurvey">新建问卷</el-button>
-        </el-col>
-        <el-col :span="12" class="flex">
-          <el-input
-            class="ml-2"
-            v-model="query.key"
-            placeholder="请输入问卷搜索"
-            clearable
-          />
-          <el-button
-            class="ml-2"
-            type="primary"
-            :icon="Search"
-            @click="onSearch"
-            :loading="loading"
-            >查询</el-button
-          >
-        </el-col>
-      </el-row>
-    </el-card>
-    <div class="mt-4">
-      <el-table :data="tableData" style="width: 100%">
-        <el-table-column prop="surveyId" label="问卷ID">
-          <template #default="{ row }">
-            {{ row.id || "-" }}
-          </template>
-        </el-table-column>
-        <el-table-column prop="id" label="问卷名称">
-          <template #default="{ row }">
-            {{ row.name || "-" }}
-          </template>
-        </el-table-column>
-        <el-table-column prop="status" label="用户是否可使用问卷">
-          <template #default="{ row }">
-            <span
-              :class="row.status == 1 ? 'text-green-500' : 'text-red-600'"
-              >{{ row.status == 1 ? "启用" : "停用" }}</span
-            >
-          </template>
-        </el-table-column>
-        <el-table-column prop="status" label="操作" width="280">
-          <template #default="{ row }">
-            <el-space spacer="|">
-              <el-button type="primary" link @click="startOrStop(row)">{{
-                row.status === 1 ? "暂停" : "启用"
-              }}</el-button>
-              <!-- <el-button type="primary" link @click="getSurveyDetail">
-                问卷详情
-              </el-button> -->
-              <el-button type="primary" link @click="handleEditSurvey(row)">
-                设置问卷
-              </el-button>
-              <el-button type="primary" @click="handleCopyLink(row)" link>
-                问卷链接
-              </el-button>
-            </el-space>
-          </template>
-        </el-table-column>
-      </el-table>
-      <el-pagination
-        class="mt-4 justify-end"
-        background
-        :current-page="query.page"
-        :page-size="query.pageSize"
-        :total="total"
-        layout="total, prev, pager, next"
-        @current-change="onChangePage"
-      ></el-pagination>
-    </div>
-    <ComponentEditSurveyModal
-      v-model:show="visibleEditSurvey"
-      :rowData="rowData"
-      @success="getList"
-    ></ComponentEditSurveyModal>
-
-  </div>
-</template>
-<script lang="ts" setup>
-import { ref, onMounted, onBeforeUnmount, shallowRef, computed } from "vue";
-import { Search } from "@element-plus/icons-vue";
-import { uploadToOSS, debounce, request } from "@/utils";
-
-import { ElMessage, ElMessageBox } from "element-plus";
-
-import ComponentEditSurveyModal from "./Components/EditSurveyModal.vue";
-import { useUserStoreHook } from "@/store/modules/user";
-import { handleCopy } from "@/utils/index";
-
-
-const curTab = ref('system')
-const tableData = ref([]);
-const query = ref({
-  page: 1,
-  pageSize: 10,
-  key: ""
-});
-const surveyList = ref([]);
-
-const loading = ref(false);
-const total = ref(0);
-
-const { VITE_APP_H5 } = import.meta.env;
-const url = computed(() => {
-  let channelAccount = useUserStoreHook()?.profile.id;
-
-  return `${VITE_APP_H5}/#/${channelAccount}/survey`;
-});
-
-const rowData = ref({});
-const visibleEditSurvey = ref(false);
-const getList = () => {
-  loading.value = true;
-  request
-    .get("/surveyService/mechanism/survey/paginate", {
-      params: query.value
-    })
-    .then(resp => {
-      tableData.value = resp.data.list;
-      total.value = resp.data.total;
-    })
-    .finally(() => {
-      loading.value = false;
-    });
-};
-/**
- * 获取问卷列表
- */
-const getSurveyList = () => {
-  request
-    .get("/backend/survey/list", {
-      params: {
-        key: undefined
-      }
-    })
-    .then(resp => {
-      surveyList.value = resp.data.list;
-    });
-};
-
-const onSearch = () => {
-  query.value.page = 1;
-  getList();
-};
-const onChangePage = page => {
-  query.value.page = page;
-  getList();
-};
-const getSurveyDetail = row => {
-  request
-    .get("/surveyService/mechanism/survey/detail", {
-      params: {
-        id: "exZYNwWp"
-      }
-    })
-    .then(resp => {})
-    .finally(() => {
-      loading.value = false;
-    });
-};
-
-const handleEditSurvey = row => {
-  visibleEditSurvey.value = true;
-  rowData.value = row;
-};
-
-const handleCopyLink = row => {
-  if (!row.id) return;
-  handleCopy(url.value + "?id=" + row.id);
-  ElMessage.success("复制成功");
-};
-const startOrStop = row => {
-  ElMessageBox.confirm(
-    row.status === 2
-      ? "确定要启用吗?启用后该问卷用户可以正常访问 "
-      : "确定要暂停吗?暂停后该问卷用户将不能访问?",
-    "提示",
-    {
-      confirmButtonText: "确定",
-      cancelButtonText: "取消",
-      type: "warning"
-    }
-  )
-    .then(async () => {
-      await request.post(`/surveyService/mechanism/survey/update/status`, {
-        id: row.id,
-        status: row.status === 1 ? 2 : 1
-      });
-
-      ElMessage.success("操作成功");
-      getList();
-    })
-    .catch(() => {});
-};
-
-const onDelete = id => {
-  // request.post("/backend/role/delete", { id }).then(resp => {
-  //   ElMessage.success(resp.message);
-  //   getList();
-  // });
-};
-
-/** 使用公共函数,避免`removeEventListener`失效 */
-function onkeypress({ code }: KeyboardEvent) {
-  if (code === "Enter") {
-    onSearch();
-  }
-}
-
-
-onMounted(() => {
-  window.document.addEventListener("keypress", onkeypress);
-});
-
-onBeforeUnmount(() => {
-  window.document.removeEventListener("keypress", onkeypress);
-});
-
-const initData = () => {
-  getList();
-  getSurveyList();
-};
-initData();
-</script>

+ 0 - 87
src/views/physical/surveyCmps/EditDatetimeCell.vue

@@ -1,87 +0,0 @@
-<template>
-  <div>
-    <!-- <el-input v-model="result" placeholder="测试双向绑定"></el-input> -->
-    <el-date-picker
-      v-if="type === 'year'"
-      v-model="result"
-      :disabled="disable || false"
-      type="year"
-      :placeholder="placeholder || '请选择时间'"
-    >
-    </el-date-picker>
-    <el-date-picker
-      v-model="result"
-      type="date"
-      value-format="YYYY-MM-DD"
-      :disabled="disable || false"
-      v-else
-      :placeholder="placeholder || '请选择时间'"
-    >
-    </el-date-picker>
-    <!-- <Field
-    v-model="result"
-    readonly
-    name="datetimePicker"
-    is-link
-    :placeholder="props.placeholder || '点击选择时间'"
-    @click="visible = true"
-  />
-    <template v-if="props.type === 'year'">
-      <Picker
-        v-model="pickerOptions.year"
-        title="选择年份"
-        :columns="years"
-        :default-index="80"
-        @confirm="onConfirm"
-        @cancel="visible = false"
-      />
-    </template>
-    <DatetimePicker
-      v-else
-      v-model="pickerOptions.currentDate"
-      :type="props.type || 'date'"
-      title="选择时间"
-      :min-date="pickerOptions.minDate"
-      :max-date="pickerOptions.maxDate"
-      @confirm="onConfirm"
-      @cancel="visible = false"
-    /> -->
-  </div>
-</template>
-
-<script>
-// import { ref, defineProps, defineEmits, computed } from "vue";
-// const props = defineProps(["label", "type", "value", "placeholder", "disable"]);
-// const emits = defineEmits(["update:time"]);
-// const pickerOptions = ref({
-//   minDate: new Date("1900-01-01"),
-//   maxDate: new Date(),
-//   currentDate: new Date("1980-01-01")
-// });
-// const result = computed({
-//   get() {
-//     return props.value;
-//   },
-//   set(n) {
-//     emits("update:time", n);
-//   }
-// });
-export default {
-  props: ["label", "type", "value", "placeholder", "disable"],
-  data() {
-    return {};
-  },
-  computed: {
-    result: {
-      get() {
-        return this.value;
-      },
-      set(n) {
-        this.$emit("update:value", n);
-      }
-    }
-  }
-};
-</script>
-
-<style></style>

+ 0 - 21
src/views/physical/surveyCmps/ExtendsQuestionItem.vue

@@ -1,21 +0,0 @@
-<template>
-    <div>
-        {{ info }}
-    </div>
-</template>
-<script>
-import QuestionItem from './QuestionItem.vue'
-export default {
-    extends: QuestionItem,
-    data() {
-        return {
-
-        }
-    },
-    mounted() {
-        setTimeout(() => {
-            console.log(this.info);
-        }, 5000)
-    }
-}
-</script>

+ 0 - 937
src/views/physical/surveyCmps/QuestionItem.vue

@@ -1,937 +0,0 @@
-<template>
-  <el-form :inline="true" ref="form" label-width="0px">
-    <el-form-item label=" ">
-      <div
-        :style="{
-          'padding-top':
-            [QUESTION_TYPE_CHECKBOX, QUESTION_TYPE_RATING].includes(
-              item?.type
-            ) &&
-            (child || !item.isAnswered)
-              ? '25px'
-              : '',
-          'min-width': [
-            QUESTION_TYPE_RADIO,
-            QUESTION_TYPE_CHECKBOX,
-            QUESTION_TYPE_RATING
-          ].includes(item?.type)
-            ? '200px'
-            : ''
-        }"
-      >
-        <p v-if="item?.type !== QUESTION_TYPE_TEXT" class="survey-title">
-          {{
-            item?.number && item?.number?.includes("target") ? "" : item?.number
-          }}
-          {{ item?.title }}
-        </p>
-        <div
-          v-else-if="item.isHtml"
-          class="survey-title"
-          v-html="item.title"
-        ></div>
-        <p v-else class="survey-title">{{ item.title }}</p>
-        <!-- 临时选项 -->
-        <template v-if="item?.type === QUESTION_TYPE_TEMP_CHECK">
-          <!-- 常规显示 -->
-          <div class="text-left">
-            <p class="survey-desc">{{ item.config.desc }}</p>
-            <template v-if="child || !item.isAnswered">
-              <transition name="slide">
-                <div class="text-right padding-top-10">
-                  <Button
-                    color="#4B72F6"
-                    class="i-h-34px confirm-input-btn"
-                    @click="check(item, true)"
-                    >是</Button
-                  >
-
-                  <Button
-                    class="i-h-34px confirm-input-btn"
-                    @click="check(item, false)"
-                    >否</Button
-                  >
-                </div>
-              </transition>
-            </template>
-          </div>
-        </template>
-        <!-- 单选 -->
-        <template v-else-if="item?.type === QUESTION_TYPE_RADIO">
-          <!-- 常规显示 -->
-          <div class="text-left">
-            <p class="survey-desc">{{ item.config.desc }}</p>
-            <template v-if="child || !item.isAnswered">
-              <transition name="slide">
-                <div>
-                  <div
-                    v-if="
-                      item.title.includes('性别') &&
-                      /男|女/.test(item.choices.map(v => v.label).join(''))
-                    "
-                    class="gender-select"
-                  >
-                    <div v-for="(sub, idx) in item.choices" :key="idx">
-                      <div
-                        v-if="!hideList.includes(sub.number)"
-                        :data-topic="item.number"
-                        class="gender-item"
-                        :class="{
-                          active: item.value === idx
-                        }"
-                        :disabled="!child && item.isAnswered"
-                        :value="idx"
-                        @click="reply(item, sub, idx)"
-                      >
-                        <img
-                          v-if="sub.label.includes('男')"
-                          :src="iconMan"
-                          alt=""
-                          mode="cover"
-                        />
-                        <img
-                          v-if="sub.label.includes('女')"
-                          :src="iconWoman"
-                          alt=""
-                          mode="cover"
-                        />
-                        <span>{{ sub.label }}</span>
-                      </div>
-                    </div>
-                  </div>
-                  <template v-else>
-                    <div v-for="(sub, idx) in item.choices" :key="idx">
-                      <div
-                        v-if="!hideList.includes(sub.number)"
-                        :data-topic="item.number"
-                        class="sub-title mt-2"
-                      >
-                        <div
-                          class="text-left answer-btn"
-                          :class="{
-                            active: item.value === idx
-                          }"
-                          :disabled="(!child && item.isAnswered) || disable"
-                          :value="idx"
-                          @click="reply(item, sub, idx)"
-                        >
-                          {{ sub.label }}
-                        </div>
-                      </div>
-                      <!-- <Field
-                      v-if="sub.isInput && item.value === idx"
-                      v-model="sub.extra"
-                      type="textarea"
-                      :disabled="disable"
-                      autosize
-                      class="border-1 border-radius-5 margin-top-10"
-                      placeholder="请输入"
-                    /> -->
-
-                      <el-input
-                        v-if="sub.isInput && item.value === idx"
-                        v-model="sub.extra"
-                        class="margin-top-10"
-                        :disabled="disable"
-                        :autosize="{ minRows: 3, maxRows: 5 }"
-                        type="textarea"
-                        placeholder="请输入"
-                      ></el-input>
-                    </div>
-                  </template>
-                </div>
-              </transition>
-            </template>
-          </div>
-        </template>
-        <!-- 多选 -->
-        <template v-else-if="item?.type === QUESTION_TYPE_CHECKBOX">
-          <!-- 常规显示 -->
-          <div class="text-left">
-            <!-- v-if="!child || !item.isAnswered" -->
-            <div>
-              <div>
-                <p class="survey-desc">
-                  <!-- {{ item.config && item.config.desc }} -->
-                </p>
-                <span class="survey-tag">可多选</span>
-                <div v-for="(sub, idx) in item.choices" :key="idx">
-                  <div
-                    v-if="!hideList.includes(sub.number)"
-                    :key="idx"
-                    :data-topic="item.number"
-                    class="mt-2 sub-title"
-                  >
-                    <div
-                      class="text-left answer-btn"
-                      :class="{
-                        active: item.value && item.value.includes(idx)
-                      }"
-                      :disabled="!child && item.isAnswered"
-                      :value="idx"
-                      @click="reply(item, sub, idx, true)"
-                    >
-                      {{ sub.label }}
-                    </div>
-                    <el-input
-                      v-if="
-                        sub.isInput && item.value && item.value.includes(idx)
-                      "
-                      v-model="sub.extra"
-                      class="margin-top-10"
-                      :disabled="disable"
-                      :autosize="{ minRows: 3, maxRows: 5 }"
-                      type="textarea"
-                      placeholder="请输入"
-                    ></el-input>
-                  </div>
-                </div>
-              </div>
-            </div>
-          </div>
-        </template>
-        <!-- 单行文本题 -->
-        <template v-else-if="item?.type === QUESTION_TYPE_INPUT">
-          <!-- 常规显示 -->
-          <div class="text-left">
-            <template v-if="child || !item.isAnswered">
-              <transition name="slide">
-                <div>
-                  <p class="survey-desc">{{ item.config.desc }}</p>
-                  <!-- v-if="item.value !== null && item.value !== undefined" -->
-                  <div class="margin-bottom-20 margin-top-10 flex-center-v">
-                    <!-- <Field
-                    v-model="item.value"
-                    placeholder="请输入"
-                    :type="inputType(item.config.rule)"
-                    autosize
-                    :style="{
-                      width: !child ? '150px' : '100%'
-                    }"
-                    class="w-150px margin-right-10"
-                    @keyup.enter="reply(item)"
-                    /> -->
-                    <el-input
-                      v-model="item.value"
-                      :type="inputType(item.config.rule)"
-                      :style="{
-                        width: !child ? '150px' : '100%'
-                      }"
-                      clearable
-                      class="w-150px margin-right-10"
-                      @keyup.enter="reply(item)"
-                      :disabled="disable"
-                      placeholder="请输入"
-                    >
-                    </el-input>
-                    <!-- <input
-                    v-model="item.value"
-                    placeholder="请输入"
-                    class="w-150px margin-right-10 confirm-input"
-                    :style="{
-                      width: !child ? '150px' : '100%'
-                    }"
-                    :disabled="!child && item.isAnswered"
-                    :type="inputType(item.config.rule)"
-                    @keyup.enter="reply(item)"
-                    @blur="inputBlur()"
-                  /> -->
-                    <!-- <Button
-                    v-if="!child"
-                    :disabled="item.isAnswered"
-                    color="#4B72F6"
-                    class="i-h-34px confirm-input-btn"
-                    @click="reply(item)"
-                  >确定222</Button> -->
-                  </div>
-                </div>
-              </transition>
-            </template>
-          </div>
-        </template>
-        <!-- 量表题 -->
-        <template v-else-if="item?.type === QUESTION_TYPE_RATING_SCALE">
-          <!-- 常规显示 -->
-          <div class="text-left">
-            <template v-if="child || !item?.isAnswered">
-              <transition name="slide">
-                <div>
-                  <p class="survey-desc">{{ item.config.desc }}</p>
-                  <div class="row">
-                    <div class="between margin-bottom-10">
-                      <span class="margin-right-20">{{
-                        item.choices[0].label
-                      }}</span>
-                      <span class="margin-left-10">{{
-                        item.choices[1].label
-                      }}</span>
-                    </div>
-
-                    <Button
-                      v-for="(sub, idx) in item.rating"
-                      :key="idx"
-                      :disabled="!child && item?.isAnswered"
-                      :style="{
-                        marginLeft: idx ? '-1px' : ''
-                      }"
-                      :type="item.value === sub ? 'primary' : 'default'"
-                      :value="idx"
-                      @click="reply(item, sub, idx)"
-                      >{{ sub }}</Button
-                    >
-                  </div>
-                </div>
-              </transition>
-            </template>
-          </div>
-        </template>
-        <!-- 评分题 -->
-        <template v-else-if="item?.type === QUESTION_TYPE_RATING">
-          <!-- 常规显示 -->
-          <div class="text-left">
-            <template v-if="child || !item?.isAnswered">
-              <transition name="slide">
-                <div>
-                  <p class="survey-desc">{{ item.config.desc }}</p>
-                  <span class="survey-tag">可多选</span>
-                  <div v-for="(sub, idx) in item.choices" :key="idx">
-                    <div
-                      v-if="!hideList.includes(sub.number)"
-                      :key="idx"
-                      :data-topic="item.number"
-                      class="mt-2 sub-title"
-                    >
-                      <template v-if="item?.isMultiple">
-                        <div
-                          class="text-left answer-btn"
-                          :class="{
-                            active: item.value && item.value.includes(idx)
-                          }"
-                          :disabled="!child && item?.isAnswered"
-                          :value="idx"
-                          @click="reply(item, sub, idx, true)"
-                        >
-                          {{ sub.label }}
-                        </div>
-                      </template>
-                      <template v-else>
-                        <div
-                          class="text-left answer-btn"
-                          :class="{
-                            active: item.value && item.value.includes(idx)
-                          }"
-                          :disabled="!child && item?.isAnswered"
-                          :value="idx"
-                          @click="reply(item, sub, idx)"
-                        >
-                          {{ sub.label }}
-                        </div>
-                      </template>
-                    </div>
-                  </div>
-                </div>
-              </transition>
-            </template>
-          </div>
-        </template>
-        <!-- 时间题 -->
-        <template v-else-if="item?.type === QUESTION_TYPE_DATE">
-          <!-- 常规显示 -->
-          <div class="text-left">
-            <template v-if="child || !item?.isAnswered">
-              <transition name="slide">
-                <div>
-                  <p class="survey-desc">{{ item.config.desc }}</p>
-
-                  <EditDatetimeCell
-                    :disable="disable"
-                    v-model:value="item.value"
-                    :type="item.config.type"
-                    :label="item.title"
-                    :placeholder="item.config.desc"
-                  />
-                  <div class="padding-top-15 text-right">
-                    <!-- <Button
-                    v-if="!child"
-                    :disabled="!child && item.isAnswered"
-                    color="#4B72F6"
-                    class="i-h-34px confirm-input-btn"
-                    @click="reply(item)"
-                  >确定333</Button> -->
-                  </div>
-                </div>
-              </transition>
-            </template>
-          </div>
-        </template>
-        <!-- 矩阵矢量题 -->
-        <template v-else-if="item?.type === QUESTION_TYPE_MATRIX">
-          <!-- 常规显示 -->
-          <div class="text-left">
-            <template v-if="child || !item?.isAnswered">
-              <transition name="slide">
-                <div>
-                  <p class="survey-desc">{{ item.config.desc }}</p>
-                  <div class="survey-matrix-container">
-                    <table class="survey-matrix">
-                      <tr>
-                        <th></th>
-                        <th
-                          v-for="(subTh, subThIdx) in item.columns"
-                          :key="subThIdx"
-                        >
-                          {{ subTh.label }}
-                        </th>
-                      </tr>
-                      <tr v-for="(row, rowIdx) in item.rows" :key="rowIdx">
-                        <td>{{ row.label }}</td>
-                        <td
-                          v-for="(col, colIdx) in item.columns"
-                          :key="colIdx"
-                          @click="checkMatrix(rowIdx, colIdx)"
-                        >
-                          <div class="flex-center">
-                            <!-- <Icon :name="item.matrix[rowIdx][colIdx] ? 'checked' : 'circle'" color="#4B72F6" size="20" /> -->
-                            <!-- <span >选中</span>
-                            <span v-else>未选中</span> -->
-                            <el-icon
-                              :size="20"
-                              color="#4b72f6"
-                              v-if="item.matrix[rowIdx][colIdx]"
-                            >
-                              <CircleCheckFilled />
-                            </el-icon>
-                            <el-icon :size="20" v-else>
-                              <CircleCheck />
-                            </el-icon>
-                            <!-- <i
-                              v-if="item.matrix[rowIdx][colIdx]"
-                              class="el-icon-circle-check"
-                              style="color: #409eff"
-                            ></i>
-                            <i v-else class="el-icon-circle-check"></i> -->
-                          </div>
-                        </td>
-                      </tr>
-                    </table>
-                  </div>
-                  <div class="padding-top-15 text-right">
-                    <!-- <Button
-                    v-if="!child"
-                    :disabled="!child && item.isAnswered"
-                    color="#4B72F6"
-                    class="i-h-34px confirm-input-btn"
-                    @click="reply(item)"
-                  >确定444</Button> -->
-                  </div>
-                </div>
-              </transition>
-            </template>
-          </div>
-        </template>
-        <!-- 组合题 -->
-        <template v-else-if="item?.type === QUESTION_TYPE_COMBINATION">
-          <!-- 常规显示 -->
-          <div class="text-left">
-            <template v-if="child || !item?.isAnswered">
-              <transition name="slide">
-                <div>
-                  <p class="survey-desc">{{ item.config.desc }}</p>
-                  <div
-                    v-for="(sub, subIdx) in item.children"
-                    :key="subIdx"
-                    class="padding-top-15"
-                  >
-                    <QuestionItem
-                      :info="sub"
-                      :child="true"
-                      class="w-100"
-                      @skip="skip"
-                      @back="back"
-                    />
-                  </div>
-                  <div class="padding-top-15 text-right">
-                    <!-- <Button
-                    :disabled="!child && item.isAnswered"
-                    color="#4B72F6"
-                    class="i-h-34px confirm-input-btn"
-                    @click="reply(item)"
-                  >确定555</Button> -->
-                  </div>
-                </div>
-              </transition>
-            </template>
-          </div>
-        </template>
-        <template v-if="!child">
-          <!-- <p
-          v-if="!item.isAnswered && !item.config.required"
-          class="link text-center"
-          @click="skip(item)"
-        >
-          跳过该题
-        </p> -->
-          <!-- <p
-          v-if="!item.isAnswered && item.isRepeat && !item.noLast"
-          class="link text-center"
-          @click="repeat(item)"
-        >
-          <Icon name="plus" />
-          新增
-        </p> -->
-          <div v-if="!item?.isAnswered && item?.isMultiple" class="flex-center">
-            <!-- <Button
-            type="primary" round
-            class="link text-center confirm-btn"
-            size="small"
-            @click="reply(item, null, undefined)"
-          >确定111<span v-if="item.value.length">({{ item.value.length }}个)</span>  </Button> -->
-          </div>
-          <!-- <p
-          v-if="repeatAnswer"
-          class="link text-center"
-          @click="back(item)"
-        >
-          重答该题
-        </p> -->
-        </template>
-      </div>
-    </el-form-item>
-  </el-form>
-</template>
-
-<script>
-// import { Button, Icon, Notify, Field, Image, FieldType } from 'vant'
-// import { formatAge, inputBlur } from '@/utils/index';
-import EditDatetimeCell from "./EditDatetimeCell.vue";
-import { CircleCheck, CircleCheckFilled } from "@element-plus/icons-vue";
-import { Tools } from "@element-plus/icons-vue";
-import iconMan from "@/assets/icon-man.png";
-import iconWoman from "@/assets/icon-woman.png";
-
-// import ExtendsQuestionItem from './ExtendsQuestionItem.vue';
-// import M from "minimatch";
-
-export default {
-  name: "QuestionItem",
-  data() {
-    return {
-      iconMan,
-      iconWoman,
-      QUESTION_TYPE_TEMP_CHECK: "temp_check", // 单选 => Q1A1
-      QUESTION_TYPE_INPUT: "input", // 输入 => Q1
-      QUESTION_TYPE_TEXT: "text", // 输入 => Q1
-      QUESTION_TYPE_CHECKBOX: "checkbox", // 多选 => Q1A1
-      QUESTION_TYPE_RADIO: "radio", // 单选 => Q1A1
-      QUESTION_TYPE_RATING_SCALE: "rating_scale", // 量表(一排的radio选择指定) => Q1
-      QUESTION_TYPE_RATING: "rating", // 评分题(选项后面有分值) => Q1A1
-      QUESTION_TYPE_DATE: "date", // 时间题
-      QUESTION_TYPE_MATRIX: "matrix_checkbox", // 矢量题
-      QUESTION_TYPE_COMBINATION: "group", // 组合题
-      replyLock: false
-    };
-  },
-  components: {
-    // ExtendsQuestionItem,
-    EditDatetimeCell,
-    Tools,
-    CircleCheck,
-    CircleCheckFilled
-  },
-  props: {
-    info: {
-      type: Object,
-      default: () => {}
-    },
-    hideList: {
-      type: Array,
-      default: () => []
-    },
-    repeatAnswer: {
-      type: Boolean,
-      default: false
-    },
-    child: {
-      type: Boolean,
-      default: false
-    },
-    disable: {
-      type: Boolean,
-      default: false
-    },
-    answerResult: {
-      type: Object,
-      default: () => {}
-    }
-  },
-  computed: {
-    item: {
-      get() {
-        return this.initData();
-      },
-      set(value) {
-        this.$emit("update:info", value);
-      }
-    }
-  },
-  watch: {
-    info: {
-      handler(n, o) {},
-      deep: true
-    }
-  },
-  mounted() {
-    // this.init();
-  },
-  methods: {
-    initData() {
-      let info = this.info;
-      if (!this.answerResult) return info;
-      if (Object.keys(this.answerResult).includes(info.sn)) {
-        if (info.type == this.QUESTION_TYPE_COMBINATION) {
-          let groupAnswers = this.answerResult[info.sn].groupAnswers;
-          info.children = info.children.map(v => {
-            let test = groupAnswers
-              .find(vv => vv.find(vvv => v.sn === vvv.questionNo))
-              .find(vvvv => v.sn == vvvv.questionNo);
-            return this.formatAnswer(v, test);
-          });
-          console.log("多选题", info);
-        }
-        return this.formatAnswer(info, this.answerResult[info.sn]);
-      } else {
-        return this.info;
-      }
-    },
-
-    formatAnswer(item, currentAnswer) {
-      let info = item;
-      if (!this.answerResult) return info;
-      // let currentAnswer = answerResult[info.sn];
-
-      // 单选
-      if (info.type == this.QUESTION_TYPE_RADIO) {
-        info.value = info.choices.findIndex(
-          v => v.attr == currentAnswer?.answer?.key
-        );
-      } else if (info.type == this.QUESTION_TYPE_MATRIX) {
-        let row = info.rows;
-        let columns = info.columns;
-        let matrix = [];
-
-        for (let i = 0; i < row.length; i++) {
-          let colArr = [];
-          for (let j = 0; j < columns.length; j++) {
-            colArr.push(false);
-            currentAnswer.matrixAnswers.map(v => {
-              if (v.xKey == row[i]["attr"] && v.yKey == columns[j]["attr"]) {
-                console.log(i, j);
-                colArr[j] = true;
-              }
-            });
-          }
-          matrix.push(colArr);
-        }
-        info.matrix = matrix;
-      } else if (info.type == this.QUESTION_TYPE_CHECKBOX) {
-        let checkBoxValue = currentAnswer.checkboxAnswers.map(v => {
-          return info.choices.findIndex(vv => vv.attr == v.key);
-        });
-        info.value = checkBoxValue;
-      } else if (info.type == this.QUESTION_TYPE_INPUT) {
-        info.value = currentAnswer.inputAnswers.value[0];
-      } else {
-        info.value = currentAnswer?.answer?.value;
-      }
-      return info;
-    },
-    init() {
-      console.log("初始化成功");
-      // if (this.item?.type === this.QUESTION_TYPE_MATRIX) {
-      //   console.log("测试", this.item);
-
-      //   this.item.matrix = Array(this.item.rows.length)
-      //     .fill(0)
-      //     .map(() => Array(this.item.columns.length).fill(false))
-      //     .map((rows, rowIdx) => {
-      //       rows = rows.map((col, colIdx) => {
-      //         if (this.item.value && Array.isArray(this.item.value)) {
-      //           return this.item.value.includes(
-      //             this.item.rows[rowIdx].label + this.item.columns[colIdx].label
-      //           );
-      //         }
-      //         return col;
-      //       });
-      //       return rows;
-      //     });
-      // }
-      // console.log(this.item.matrix);
-    },
-
-    inputType(rule) {
-      switch (rule) {
-        case "number":
-          return rule;
-        case "phone":
-          return "tel";
-        default:
-          return "text";
-      }
-    },
-    // 矩阵题选择
-    checkMatrix(rowIdx, colIdx) {
-      if (this.disable) true;
-      console.log(rowIdx, colIdx);
-      // console.log(this.item);
-      // console.log(this.item.matrix)
-      let curState = this.item.matrix[rowIdx][colIdx];
-      let isMultiple = this.item.isMultiple;
-      let mutuallyExclusive = this.item.columns[colIdx].mutuallyExclusive;
-      // 单选
-      if (!isMultiple) {
-        this.item.matrix[rowIdx].forEach((v, k) => {
-          this.item.matrix[rowIdx][k] = k === colIdx ? !curState : false;
-          // this.$set(
-          //   this.item.matrix[rowIdx],
-          //   k,
-          //   k === colIdx ? !curState : false
-          // );
-        });
-      } else {
-        // 多选
-        // 该列有互斥
-        if (mutuallyExclusive) {
-          if (curState) {
-            this.item.matrix[rowIdx][colIdx] = !curState;
-            // this.$set(this.item.matrix[rowIdx], colIdx, !curState);
-          } else {
-            this.item.matrix[rowIdx].forEach((v, k) => {
-              item.value.matrix[rowIdx][k] = k === colIdx;
-              // this.$set(this.item.matrix[rowIdx], k, k === colIdx);
-            });
-          }
-        } else {
-          this.item.matrix[rowIdx].forEach((v, k) => {
-            if (this.item.columns[k].mutuallyExclusive) {
-              this.item.matrix[rowIdx][k] = false;
-              // this.$set(this.item.matrix[rowIdx], k, false);
-            }
-          });
-          this.item.matrix[rowIdx][colIdx] = !this.item.matrix[rowIdx][colIdx];
-          // this.$set(
-          //   this.item.matrix[rowIdx],
-          //   colIdx,
-          //   !this.item.matrix[rowIdx][colIdx]
-          // );
-        }
-      }
-      console.log(this.item.matrix);
-    },
-    skip(item) {
-      this.item = null;
-      this.$emit("skip", item);
-    },
-    back(item) {
-      this.$emit("back", item);
-    },
-    check(item, flag) {
-      if (this.disable) return;
-      this.$emit("check", item, flag);
-    },
-    checkReply(item) {
-      if (item?.type === this.QUESTION_TYPE_MATRIX) {
-        return true;
-      } else if (item["choices"].length) {
-        if (
-          (!item.value && item.value !== 0) ||
-          (Array.isArray(item.value) && !item.value.length)
-        ) {
-          Notify({ type: "danger", message: "请选择" });
-          replyLock.value = false;
-          return false;
-        }
-      } else {
-        if (!item.value && item.value !== 0) {
-          // Notify(item.value)
-          Notify({
-            type: "danger",
-            message: `请${
-              item?.type === this.QUESTION_TYPE_DATE ? "选择" : "填写正确内容"
-            }后提交`
-          });
-          replyLock.value = false;
-          return false;
-        }
-      }
-      return true;
-    },
-    reply(item, sub, idx, skip = false) {
-      if (this.disable) return;
-      if (this.replyLock) return;
-      console.log("执行reply", item, sub, skip);
-
-      this.replyLock = true;
-      let text = "";
-      if (item?.type === this.QUESTION_TYPE_INPUT) {
-        if (!this.checkReply(item)) return;
-        if (item.config.rule) {
-          let reg = null;
-          let errMsg = "";
-          switch (item.config.rule) {
-            case "number":
-              reg = /^\d+(\d+|\.\d+)?$/;
-              errMsg = "请输入数字";
-              break;
-            case "phone":
-              reg = /^(?:(?:\+|00)86)?1\d{10}$/;
-              errMsg = "请输入手机号码";
-              break;
-          }
-          if (reg && !new RegExp(reg).test(item.value)) {
-            Notify({ type: "danger", message: errMsg });
-            this.replyLock = false;
-            return;
-          }
-        }
-        text = item.value;
-      } else if (
-        item?.type === this.QUESTION_TYPE_CHECKBOX ||
-        (item?.type !== this.QUESTION_TYPE_MATRIX && item.isMultiple)
-      ) {
-        if (skip) {
-          // let temp = [] as Array<number>
-          if (
-            typeof item.value === "string" ||
-            (!item.value && item.value !== 0)
-          ) {
-            item.value = [idx];
-          } else {
-            if (sub.mutuallyExclusive) {
-              item.value = [idx];
-            } else {
-              item.value = item.value.filter(
-                v => !item.choices[v].mutuallyExclusive
-              );
-              if (item.value.includes(idx)) {
-                item.value.splice(item.value.indexOf(idx), 1);
-              } else {
-                item.value = [...new Set([...item.value, idx])];
-              }
-            }
-          }
-          this.replyLock = false;
-          return;
-        } else {
-          if (item.isMultiple) {
-            if (!this.checkReply(item)) return;
-            if (Array.isArray(item.value)) {
-              text = [];
-              item.value.map(v => {
-                text.push(item.choices[v].label);
-              });
-              text = text.join();
-            }
-          } else {
-            text = idx;
-          }
-        }
-      } else if (item?.type === this.QUESTION_TYPE_COMBINATION) {
-        let val = [];
-        let t = [];
-        for (const child of item.children) {
-          console.log("组合题执行到这里来了", !this.checkReply(child));
-
-          if (!this.checkReply(child)) return;
-          if (child.type === this.QUESTION_TYPE_MATRIX) {
-            let res = [];
-            child.matrix.forEach((cols, k1) => {
-              cols.forEach((c, k2) => {
-                c &&
-                  res.push(child.rows[k1].label + "" + child.columns[k2].label);
-              });
-            });
-            if (res.length) {
-              t.push(res.join(","));
-              val.push(res);
-            } else {
-              t.push("无");
-              val.push(["无"]);
-            }
-          } else if (child["choices"].length) {
-            t.push(
-              Array.isArray(child.value)
-                ? child.value.map(c => child["choices"][c].label).join(",")
-                : child["choices"][child.value].label
-            );
-            val.push(child.value);
-          } else {
-            t.push(child.value);
-            val.push(child.value);
-          }
-        }
-        text = t.join(",");
-      } else if (item?.type === this.QUESTION_TYPE_RATING_SCALE) {
-        item.value = sub;
-        text = sub;
-      } else if (item?.type === this.QUESTION_TYPE_DATE) {
-        if (!this.checkReply(item)) return;
-        item.value = item.value || "";
-        text = item.config.rule === "age" ? formatAge(item.value) : item.value;
-      } else if (item?.type === this.QUESTION_TYPE_MATRIX) {
-        let res = [];
-        item.matrix.forEach((cols, k1) => {
-          cols.forEach((c, k2) => {
-            c && res.push(item.rows[k1].label + "" + item.columns[k2].label);
-          });
-        });
-        item.value = res && res.length ? res : ["无"];
-        text = res && res.length ? res.join(",") : "无";
-      } else {
-        console.log(`执行到else来了 ${item?.type}`);
-
-        item.value = idx;
-        text = item.choices[idx].label;
-      }
-      item.isAnswered = false;
-      this.replyLock = false;
-      this.$emit("reply", item, text);
-    }
-  }
-};
-// const emits = defineEmits(['update:info', 'skip', 'back', 'check', 'reply' ])
-// console.log(info);
-</script>
-
-<style lang="scss" scoped>
-.survey-matrix-container {
-  overflow-x: auto;
-  padding: 10px 0;
-  .survey-matrix {
-    font-size: 12px;
-    border-collapse: collapse;
-    margin: 0 auto;
-    min-width: 100%;
-    th,
-    td {
-      border: 1px solid #ccc;
-      padding: 10px;
-      text-align: center;
-    }
-    th {
-      white-space: nowrap;
-    }
-    tr {
-      td:first-of-type {
-        font-weight: blod;
-        white-space: nowrap;
-      }
-    }
-  }
-}
-.confirm-input-btn {
-  cursor: pointer;
-  &:not(:last-of-type) {
-    margin-right: 10px;
-  }
-}
-</style>

+ 0 - 1217
src/views/physical/surveyCmps/Questions.vue

@@ -1,1217 +0,0 @@
-<template>
-  <div ref="home" class="home">
-    <div class="dialogue-list">
-      <!-- <div v-if="state.detail.greeting_text" class="dialogue-item">
-        <Image
-          v-if="state.detail.style"
-          :src="state.detail.style[0]"
-          class="avatar"
-        />
-
-        <div class="dialogue-content">{{ state.detail.greeting_text }}</div>
-      </div> -->
-      <div
-        v-for="(item, surveyIndex) in showList"
-        :key="surveyIndex"
-        class="dialogue-item"
-      >
-        <Image
-          v-if="state.detail.style && item.type != 'answer'"
-          class="avatar"
-          :src="state.detail.style[0]"
-        />
-        <!-- :repeat-answer="item.isAnswered && lastIndex === surveyIndex" -->
-        <QuestionItem
-          :info="item"
-          :hide-list="hideList"
-          class="dialogue-content"
-          ref="questionItem"
-          @skip="skip"
-          @back="back"
-          @reply="reply"
-          @check="check"
-          :disable="details.status == 3"
-          :answerResult="answerResult"
-        ></QuestionItem>
-        <Image
-          v-if="state.detail.style && item.type === 'answer'"
-          class="avatar"
-          :src="state.detail.style[1]"
-        />
-        <el-divider></el-divider>
-      </div>
-
-      <template v-if="state.inputLoading">
-        <div
-          class="dialogue-item animate__animated animate__faster animate__slideInLeft"
-        >
-          <Image
-            v-if="state.detail.style"
-            class="avatar"
-            :src="state.detail.style[0]"
-          />
-
-          <div class="dialogue-content">
-            <span>...</span>
-          </div>
-        </div>
-      </template>
-
-      <!-- <template v-if="state.isFinished">
-
-        <div
-          v-if="state.detail.finished_text"
-          class="dialogue-item animate__animated animate__fast animate__slideInLeft"
-        >
-
-          <Image v-if="state.detail.style" class="avatar" :src="state.detail.style[0]" />
-
-          <div class="dialogue-content">
-
-            <span>{{ state.detail.finished_text }}</span>
-
-            <Button
-              block
-              type="primary"
-              class="full-btn"
-              @click="save"
-              :disabled="checkDisabled"
-              :loading="checkDisabled"
-            >
-              查看
-            </Button>
-
-          </div>
-
-        </div>
-
-      </template> -->
-    </div>
-  </div>
-</template>
-
-<script>
-// import { resolvingDslLogic, surveyByCode } from '../utils/axios'
-// import { inputBlur, wxPlusReady } from '@/utils'
-// import { Notify, Toast, Button, Image, Dialog } from 'vant'
-import { empty } from "@/utils/index";
-import QuestionItem from "./QuestionItem.vue";
-export default {
-  data() {
-    return {
-      QUESTION_TYPE_TEMP_CHECK: "temp_check",
-      QUESTION_TYPE_ANSWER: "answer",
-      QUESTION_TYPE_INPUT: "input",
-      QUESTION_TYPE_TEXT: "text",
-      QUESTION_TYPE_CHECKBOX: "checkbox",
-      QUESTION_TYPE_RADIO: "radio",
-      QUESTION_TYPE_RATING_SCALE: "rating_scale",
-      QUESTION_TYPE_RATING: "rating",
-      QUESTION_TYPE_DATE: "date",
-      QUESTION_TYPE_MATRIX: "matrix_checkbox",
-      QUESTION_TYPE_COMBINATION: "group",
-      state: {
-        detail: {
-          id: "",
-          title: "",
-          code: "",
-          questions: [],
-          survey_rules: {
-            status: ""
-          },
-          greeting_text: "",
-          finished_text: "",
-          style: [],
-          peg: "",
-          updated_at: ""
-        },
-        index: 0,
-        isFinished: false,
-        loading: null,
-        inputLoading: false,
-        survey_id: "",
-        replyLock: false
-      },
-      rawList: [],
-      showList: [],
-      hideList: [],
-      rules: [],
-      checkDisabled: false,
-      home: ""
-    };
-  },
-  props: {
-    details: {
-      type: Object,
-      default: () => {}
-    },
-    answerResult: {
-      type: Object,
-      default: () => {}
-    }
-  },
-  components: {
-    QuestionItem
-  },
-  computed: {
-    noAnswer() {
-      return this.showList.filter(
-        v =>
-          ![
-            this.QUESTION_TYPE_TEXT,
-            this.QUESTION_TYPE_ANSWER,
-            this.QUESTION_TYPE_TEMP_CHECK
-          ].includes(v.type)
-      );
-    },
-    lastIndex() {
-      for (let i = this.showList.length - 1; i >= 0; i--) {
-        if (this.showList[i].isAnswered) {
-          return i;
-        }
-      }
-      return 0;
-    }
-  },
-  methods: {
-    reset() {
-      (this.state = {
-        detail: {
-          id: "",
-          title: "",
-          code: "",
-          questions: [],
-          survey_rules: {
-            status: ""
-          },
-          greeting_text: "",
-          finished_text: "",
-          style: [],
-          peg: "",
-          updated_at: ""
-        },
-        index: 0,
-        isFinished: false,
-        loading: null,
-        inputLoading: false,
-        survey_id: "",
-        replyLock: false
-      }),
-        (this.rawList = []);
-      this.showList = [];
-      this.hideList = [];
-      this.rules = [];
-      this.checkDisabled = false;
-      this.home = "";
-    },
-    async init() {
-      this.reset();
-      this.state.detail = this.details;
-      // state.survey_id = data.id
-      this.state.detail.questions = this.state.detail.questions.map(v => {
-        if (v.type === this.QUESTION_TYPE_RATING_SCALE) {
-          v.rating = [];
-          for (let i = 0; i < v.max; i++) {
-            v.rating.push(i + v.min);
-          }
-        }
-        if (v.type === this.QUESTION_TYPE_COMBINATION) {
-          if (v.children.find(v2 => v2.isRepeat)) {
-            v.isRepeat = true;
-          }
-        }
-        return v;
-      });
-      this.rawList = this.state.detail.questions;
-      // this.showList = [this.state.detail.questions[0]]
-      this.showList = this.state.detail.questions;
-      console.log("this.showList", this.showList);
-      let peg = null;
-      try {
-        peg = this.state.detail.peg ? JSON.parse(this.state.detail.peg) : {};
-      } catch (e) {
-        console.log(e);
-        peg = {};
-      }
-      this.rules = peg.rules || {};
-      console.log("state.detail", this.state.detail);
-      console.log("rules.value", this.rules);
-      this.$nextTick(() => {
-        // this.inputBlur()
-      });
-
-      console.log(this.showList);
-      this.$nextTick(async () => {
-        this.$refs["questionItem"].forEach(v => {
-          v.init();
-        });
-        this.recover();
-        // 普通问卷不走规则校验;
-        // if(this.details.survey.type == 1) return;
-        // let list = [];
-        // this.showList.forEach( v => {
-        //   list.push(this.next(v, true, (number) => {
-        //     list.push(number);
-        //     list = list.filter(v =>  typeof v === 'number');
-        //     this.showList = this.showList.splice(0, list[0]);
-        //     console.log(this.showList);
-        //   }));
-        // })
-        // setTimeout(() => {
-        //   console.log("跑规则之后的list==>", list);
-        // }, 3000)
-      });
-    },
-    pushText(text, time, isHtml = false) {
-      return new Promise((resolve, reject) => {
-        this.showList.push({
-          title: text,
-          config: {
-            desc: "",
-            required: true
-          },
-          isHtml,
-          type: this.QUESTION_TYPE_TEXT
-        });
-        setTimeout(() => {
-          resolve(1);
-        }, time || 8e2);
-      });
-    },
-
-    skip(item) {
-      item.isAnswered = true;
-      this.next(item);
-    },
-    back(item) {
-      if (this.state.replyLock) return;
-      console.log(this.rules);
-      let backList = this.rules[item.number]
-        .filter(v => v.method === "hide" && v.expression.includes(item.number))
-        .map(v => v.question)
-        .flat();
-      if (backList.length) {
-        backList.forEach(k => {
-          let delIdx = this.hideList.findIndex(v => v == k);
-          delIdx >= 0 && this.hideList.splice(delIdx, 1);
-        });
-      }
-      this.showList.splice(
-        this.lastIndex + 1,
-        this.showList.length - this.lastIndex
-      );
-      item.isAnswered = false;
-      item.value = "";
-      this.state.isFinished = false;
-    },
-
-    check(item, flag) {
-      if (item.isRepeat) {
-        this.repeat(item, flag);
-      } else if (item.isEnd) {
-        console.log(item);
-        this.showList.splice(this.showList.length - 1, 1);
-        if (flag) {
-          this.state.isFinished = true;
-        } else {
-          this.next(this.noAnswer.at(-1), false);
-        }
-        // window.scrollTo(0, home.value.scrollHeight)
-        this.home.scrollTo(0, this.home.scrollHeight);
-      }
-    },
-
-    repeat(item, flag) {
-      if (flag) {
-        this.showList.splice(this.showList.length - 1, 1);
-        this.$nextTick(() => {
-          let item = JSON.parse(JSON.stringify(this.noAnswer.at(-1)));
-          if (item.type === this.QUESTION_TYPE_COMBINATION) {
-            item.children = item.children.map(v => {
-              v.value = Array.isArray(v.value) ? [] : "";
-              return v;
-            });
-          }
-          this.showList.push({
-            ...item,
-            isAnswered: false,
-            value: ""
-          });
-          // window.scrollTo(0, home.value.scrollHeight)
-          this.home.scrollTo(0, this.home.scrollHeight);
-        });
-      } else {
-        this.showList.splice(this.showList.length - 1, 1);
-        this.next(this.noAnswer.at(-1));
-      }
-    },
-    reply(item, text) {
-      return;
-      this.showList.push({
-        left: false,
-        title: text,
-        type: this.QUESTION_TYPE_ANSWER,
-        config: {
-          required: true
-        }
-      });
-      if (item.isRepeat) {
-        this.showList.push({
-          title: "是否再增加一条记录?",
-          config: {
-            desc: "",
-            required: true
-          },
-          isRepeat: true,
-          type: this.QUESTION_TYPE_TEMP_CHECK
-        });
-        console.log(showList.value);
-        // window.scrollTo(0, home.value.scrollHeight)
-
-        this.home.value.scrollTo(0, this.home.scrollHeight);
-        return;
-      }
-      this.next(this.noAnswer.at(-1));
-    },
-    getItem(number) {
-      return this.rawList.find(v => v.number === number);
-    },
-    getQ(number) {
-      let items = this.showList.filter(v => v.number === number);
-      let item = this.getItem(number);
-      if (items.length > 1) {
-        return items.map(this.formatItemVal);
-      }
-      let val = item.value;
-
-      if (item.type === this.QUESTION_TYPE_RADIO) {
-        return [val];
-      } else if (item.type === this.QUESTION_TYPE_CHECKBOX) {
-        return val || [];
-      }
-      return item.value;
-    },
-    getS(number) {
-      var q = number.match(/Q\d+/)[0];
-      var s = Number(number.match(/S\d+/)[0].slice(1)) - 1;
-      var a = number.includes("A")
-        ? Number(number.match(/A\d+/)[0].slice(1)) - 1
-        : "";
-      console.log(
-        `当前获取${number} 获取到的q: ${q} ,获取到的s: ${s} ,获取到的a: ${a}`
-      );
-      return a ? this.getItem(q).matrix[s][a] : this.getItem(q).matrix[s];
-    },
-    getA(number) {
-      let q = number.match(/Q\d+/)[0];
-      let a = Number(number.match(/A\d+/)[0].slice(1)) - 1;
-      console.log(`当前获取${number} 获取到的q: ${q} ,获取到的a: ${a}`);
-      console.log(`获取到的q:`);
-      let qVal = Array.isArray(this.getQ(q))
-        ? this.getQ(q).map(String)
-        : this.getQ(q) || "";
-      return qVal.includes(String(a));
-    },
-    getVal(number) {
-      return number.includes("S")
-        ? this.getS(number)
-        : number.includes("A")
-        ? this.getA(number)
-        : this.getQ(number);
-    },
-    getRuleKey(type) {
-      switch (type) {
-        case "showHide":
-        case "to":
-          return "expression";
-        case "say":
-        case "replace":
-          return "keyword";
-        default:
-          return "";
-      }
-    },
-    formatAge(birthday) {
-      if (!birthday) return "";
-      if (!isNaN(Number(birthday))) return birthday;
-      const offset = +new Date() - +new Date(birthday.replace(/-/g, "/"));
-      return parseInt(String(offset / 86400000 / 365));
-    },
-    formatRule(rule) {
-      let getQAReg = new RegExp(/Q\d+(S\d+)?(A\d+)?/gi);
-      let rawCondition = rule[this.getRuleKey(rule.type)] || "";
-      rawCondition = rawCondition
-        .replace(/ and /g, " && ")
-        .replace(/ or /g, " || ");
-      let condition = rawCondition;
-      let replaceReg = undefined;
-      let qa = [];
-      if (condition) {
-        console.log(
-          `%c当前的规则: ${condition}`,
-          "font-size: 16px; color: #4b72f6;"
-        );
-        qa = rawCondition.match(getQAReg) || [];
-        console.log(qa);
-        qa.map(n => {
-          let v = this.getVal(n);
-          console.log("获取到的值:", v, "获取的:", n);
-
-          let reg = new RegExp(n);
-          console.log(`要执行的正则`, reg, v);
-          condition = condition.replace(
-            reg,
-            Array.isArray(v)
-              ? `[${v
-                  .map(v2 => (typeof v2 === "string" ? `'${v2}'` : v2))
-                  .join(",")}]`
-              : typeof v === "string"
-              ? `'${v}'`
-              : v
-          );
-          console.log(condition);
-        });
-
-        console.log(`获取到的qa`);
-        console.log(qa);
-        console.log(`最后的condition`);
-        console.log(condition);
-      }
-      let flag = true;
-      // try {
-      //   flag = eval(condition)
-      // } catch (e) {
-      //   flag = false
-      // }
-      console.log(`当前规则执行的flag: %c ${flag}`, "color: #f00;");
-
-      switch (rule.type) {
-        case "showHide":
-          console.log(
-            `执行---------------show hide -----------规则: ${condition}`
-          );
-          if (flag) {
-            if (rule.method == "hide") {
-              this.hideList.push(...rule.question);
-            }
-          }
-          break;
-        case "to":
-          console.log(`执行---------------to-----------规则: ${condition}`);
-          return flag
-            ? {
-                type: "to",
-                to: rule.to
-              }
-            : undefined;
-        case "say":
-          console.log(`执行---------------say-----------规则: ${condition}`);
-          if (flag) {
-            return {
-              type: "say",
-              say: rule.say
-            };
-          }
-          break;
-
-        case "replace":
-          console.log(
-            `执行---------------replace-----------规则: ${condition}`
-          );
-          replaceReg = new RegExp(rule.keyword);
-          console.log(`执行正则: ${rule.keyword}`);
-
-          {
-            let t = undefined;
-            let q = this.getItem(rule.from);
-            console.log(`当前replace-q: `);
-            console.log(q);
-            if (rule.index >= 0) {
-              console.log(q["choices"][rule.index - 1]);
-              t = q["choices"][rule.index - 1].label;
-            } else {
-              if (q["choices"]) {
-                t = q["choices"][Number(getQ(rule.from))].label;
-              } else {
-                t = q.value;
-              }
-            }
-            console.log(`获取到的t: ${t}`);
-
-            this.getItem(rule.to).title = this.getItem(rule.to).title.replace(
-              replaceReg,
-              Array.isArray(t) ? t.join(",") : t
-            );
-          }
-          break;
-        case "end":
-          this.showList.push({
-            title: "是否结束答题?",
-            config: {
-              desc: "",
-              required: true
-            },
-            isEnd: true,
-            type: this.QUESTION_TYPE_TEMP_CHECK
-          });
-          return {
-            type: "end"
-          };
-      }
-    },
-    handleSubmit() {
-      // localStorage.setItem(
-      //       `temp_q2_${this.details.code}`,
-      //       JSON.stringify({
-      //         state: this.state,
-      //         rawList: this.rawList,
-      //         showList: this.showList,
-      //         hideList: this.hideList,
-      //         rules: this.rules
-      //       })
-      //     )
-      console.log(this.details);
-      let type = this.details.type;
-      console.log(type);
-      let { list, isAllAnswer } =
-        type == 1 ? this.saveGeneralSurvey() : this.save();
-      // this.save();
-
-      return {
-        surveyInfo: JSON.stringify({
-          // surveyId: this.details.id,
-          state: this.state,
-          rawList: this.rawList,
-          showList: this.showList,
-          hideList: this.hideList,
-          rules: this.rules
-        }),
-        questions: list,
-        isAllAnswer
-      };
-    },
-    recover() {
-      const tempQuestions =
-        this.details.answerCache && JSON.parse(this.details.answerCache);
-      console.log("缓存", tempQuestions);
-      if (tempQuestions) {
-        // if (tempQuestions.state.detail.updated_at != state.detail.updated_at) {
-        //   return localStorage.removeItem(`temp_q2_${this.details.code}`)
-        // }
-        console.log("存在缓存题目");
-
-        Object.keys(tempQuestions.state).forEach(key => {
-          this.state[key] = tempQuestions.state[key];
-          // console.log(key, tempQuestions.state[key])
-        });
-        this.rawList = tempQuestions.rawList;
-        this.showList = tempQuestions.showList;
-        this.hideList = tempQuestions.hideList;
-        this.rules = tempQuestions.rules;
-
-        console.log("showList==>", this.showList);
-      }
-    },
-    async next(item, runRule = true, callback) {
-      this.state.replyLock = true;
-      console.log("规则判断");
-      let rule = this.rules[item.number];
-      console.log("==================start=====================");
-      let to = undefined;
-      try {
-        if (runRule) {
-          for (let i in rule || []) {
-            console.log("执行规则", i + 1, "-----type:", rule[i].type);
-            let res = this.formatRule(rule[i]) || {};
-            console.log(res);
-            switch (res.type) {
-              case "to":
-                to = res.to || undefined;
-                break;
-              case "say":
-                // res.say && (await this.pushText(res.say || '', 0, true))
-                break;
-              case "end":
-                this.state.replyLock = false;
-                return;
-            }
-          }
-        }
-      } catch (e) {
-        console.log("报错了");
-        console.log(e);
-        // Notify(e.message)
-      }
-      console.log("==================end=======================");
-      console.log(to);
-      console.timeEnd("规则执行结束");
-
-      this.state.inputLoading = true;
-      this.$nextTick(async () => {
-        setTimeout(async () => {
-          this.state.inputLoading = false;
-          if (to) {
-            console.log("存在to跳转");
-            if (to.toLocaleLowerCase() === "end") {
-              this.state.isFinished = true;
-              callback &&
-                callback(Number(item.number.match(/Q\d+/gi)[0].slice(1)));
-              // return Number(item.number.match(/Q\d+/gi)[0].slice(1))
-            } else {
-              // this.showList.push(this.getItem(to))
-              // return this.getItem(to)
-            }
-          } else {
-            console.log("不存在to跳转");
-            this.state.index = Number(item.number.match(/Q\d+/gi)[0].slice(1));
-            if (this.state.index >= this.rawList.length) {
-              this.state.isFinished = true;
-            } else {
-              console.log("执行到这里", this.state.index);
-              // this.showList.push(this.rawList[this.state.index])
-              // return this.rawList[this.state.index]
-            }
-          }
-          this.state.replyLock = false;
-          // localStorage.setItem(
-          //   `temp_q2_${this.$route.query.code}`,
-          //   JSON.stringify({
-          //     state: this.state,
-          //     rawList: this.rawList,
-          //     showList: this.showList,
-          //     hideList: this.hideList,
-          //     rules: this.rules
-          //   })
-          // )
-          // this.$nextTick(() => {
-          //   // window.scrollTo(0, home.value.scrollHeight)
-          //   this.home.scrollTo(0, this.home.scrollHeight)
-          //   if (this.state.isFinished) return
-          // })
-        }, 700);
-      });
-    },
-    //
-    saveGeneralSurvey() {
-      let list = [];
-      this.noAnswer.map(item => {
-        let temp = {
-          type: item.type,
-          answer: "",
-          q: item.title,
-          rawAnswer: item.value,
-          choices: [],
-          config: item.config,
-          code: item.sn,
-          multipleAnswers: item.isMultiple || false,
-          qKey: item.attr
-        };
-        console.log(item);
-        switch (item.type) {
-          case this.QUESTION_TYPE_INPUT:
-            temp.answer = item.value;
-            break;
-          case this.QUESTION_TYPE_CHECKBOX:
-            temp.choices = item.choices
-              .map(v => {
-                return {
-                  label: v.label,
-                  attr: v.attr
-                };
-              })
-              .sort((a, b) => a - b);
-            temp.answer = item.value
-              ? item.value.map(v => {
-                  return {
-                    value: temp.choices[Number(v)].label,
-                    key: temp.choices[Number(v)].attr
-                  };
-                })
-              : [];
-            temp.rawAnswer = temp.answer;
-            break;
-          case this.QUESTION_TYPE_RADIO:
-            temp.choices = item.choices.map(v => {
-              return {
-                label: v.label,
-                attr: v.attr
-              };
-            });
-            temp.answer =
-              item.value || item.value === 0
-                ? {
-                    key: temp.choices[Number(item.value)].attr,
-                    value: temp.choices[Number(item.value)].label
-                  }
-                : null;
-            temp.rawAnswer = temp.answer;
-            break;
-          case this.QUESTION_TYPE_RATING_SCALE:
-            // let arr = []
-            // for (let i = item.min; i < item.max; i++) {
-            //   arr.push(i)
-            // }
-
-            temp.choices = Array(item.max - item.min)
-              .fill(null)
-              .map((_, index) => index + item.min);
-            temp.answer = item.value;
-            break;
-          case this.QUESTION_TYPE_RATING:
-            // let sum = 0
-            if (item.isMultiple) {
-              temp.answer = item.value
-                ? item.value.map(v => String(Number(v) + 1))
-                : [];
-            } else {
-              temp.answer =
-                item.value || item.value === 0
-                  ? [String(Number(item.value) + 1)]
-                  : null;
-            }
-            temp.rawAnswer = temp.answer.map(v => item.choices[v - 1].label);
-            temp.choices = item.choices.map(v => String(v.score));
-            break;
-          // 矩阵题
-          case this.QUESTION_TYPE_MATRIX:
-            let matrixValue = [];
-            item.matrix.map((v, i) => {
-              v.map((vv, ii) => {
-                let obj = {};
-                if (vv) {
-                  console.log(ii);
-                  obj["xKey"] = item.rows[i].attr;
-                  obj["xText"] = item.rows[i].label;
-                  obj["yKey"] = item.columns[ii].attr;
-                  obj["yText"] = item.columns[ii].label;
-                  matrixValue.push(obj);
-                }
-              });
-            });
-            temp.matrixValue = matrixValue;
-            break;
-          // 组合题目
-          case this.QUESTION_TYPE_COMBINATION:
-            let list = [];
-            item.children.map(v => {
-              list.push(Object.values(this.formatItemValOfGroup(v)));
-            });
-            console.log("组合题", list);
-            temp.rawAnswer = list;
-            break;
-        }
-        list.push(temp);
-      });
-      // initParser(list)
-      console.log(list);
-      let isAllAnswer = false;
-      let index = list.findIndex(v => {
-        if (v.config && v.config.required) {
-          if (Array.isArray(v.answer)) {
-            return !v.answer.length;
-          } else {
-            return !v.answer;
-          }
-        }
-      });
-      if (index < 0) {
-        isAllAnswer = true;
-      }
-      console.log(index);
-      return { list, isAllAnswer: isAllAnswer };
-    },
-    save() {
-      console.log(this.noAnswer);
-      let list = this.formatResultList(this.noAnswer);
-
-      console.log("list==>", list);
-      let result = this.formatData(list);
-      console.log("result");
-      console.log(result);
-      let isAllAnswer = false;
-      let unansweredInfo = list.find(v => {
-        // if(v.config.required) {
-        //      if( Array.isArray(v.value))return !v.length;
-        //     return !v;
-        // }
-        return (
-          v.config.required &&
-          (Array.isArray(v.value) ? !v.value.length : empty(v.value))
-        );
-      });
-      console.log("unansweredInfo==>,", unansweredInfo);
-      if (unansweredInfo && unansweredInfo.number) {
-        if (!unansweredInfo.value) {
-          isAllAnswer = false;
-        } else if (
-          Array.isArray(result.q[unansweredInfo.number]) &&
-          result.q[unansweredInfo.number].length == 0
-        ) {
-          isAllAnswer = false;
-        } else {
-          isAllAnswer = true;
-        }
-      } else {
-        isAllAnswer = true;
-      }
-
-      for (let k in result.q) {
-        if (!result.q[k]) {
-          delete result.q[k];
-        }
-      }
-      console.log(isAllAnswer);
-
-      return { list: result.q, isAllAnswer };
-      // return false
-      // const { data } = await resolvingDslLogic({
-      //   ...route.query,
-      //   questions: result.q,
-      //   targets: result.t,
-      //   lang: 'php',
-      //   survey_id: state.survey_id
-      // })
-      console.log(data);
-      console.log(data.assess);
-    },
-    formatData(list) {
-      let res = {};
-      let tar = {};
-      list.forEach(v => {
-        if (v.belongIndicator) {
-          let k = v.belongIndicator.var.replace(/target/, "T");
-          if (!tar[k]) {
-            tar[k] = {};
-          }
-          if (v.children && v.children.length) {
-            let temp = [];
-            v.value.forEach(v2 => {
-              let tempItem = {};
-              v.children.forEach((child, idx2) => {
-                if (!tar[k][child.attr]) {
-                  tar[k][child.attr] = [];
-                }
-                tar[k][child.attr].push(v2[idx2]);
-                tempItem[child.attr] = v2[idx2];
-              });
-              temp.push(tempItem);
-            });
-            res[v.number] = temp;
-          } else {
-            tar[k][v.attr] = v.isRepeat ? v.value : this.formatItemVal(v);
-            res[v.number] = Array.isArray(v.value) ? [...v.value] : v.value;
-          }
-        } else {
-          res[v.number] = v.isRepeat ? v.value : this.formatItemVal(v);
-        }
-      });
-      return {
-        t: tar,
-        q: res
-      };
-    },
-
-    formatResultList(arr) {
-      let list = [];
-      let repeatKey = [];
-      arr.forEach(v => {
-        if (v.isRepeat) {
-          if (!repeatKey.includes(v.number)) {
-            let temp = {
-              ...v,
-              value: []
-            };
-            repeatKey.push(v.number);
-            temp.value = arr
-              .filter(v2 => v2.number === v.number)
-              .map(this.formatItemVal);
-            list.push(temp);
-          }
-        } else {
-          list.push(v);
-        }
-      });
-      return list;
-    },
-    formatItemVal(item) {
-      try {
-        if (item.type === this.QUESTION_TYPE_COMBINATION) {
-          item.value = item.children.map(this.formatItemVal);
-          return item.value;
-        } else if (item.type === this.QUESTION_TYPE_MATRIX) {
-          let res = [];
-          item.matrix.forEach((cols, k1) => {
-            cols.forEach((c, k2) => {
-              c && res.push(item.rows[k1].label + "" + item.columns[k2].label);
-            });
-          });
-          item.value = res;
-          return res;
-        } else if (item["choices"].length) {
-          return Array.isArray(item.value)
-            ? item.value.map(c =>
-                item["choices"][c].isInput
-                  ? item["choices"][c].extra
-                  : item["choices"][c].label
-              )
-            : item["choices"][item.value].label;
-        } else {
-          return item.value;
-        }
-      } catch (error) {}
-    },
-
-    formatItemValOfGroup(item) {
-      let temp = {
-        type: item.type,
-        answer: "",
-        rawAnswer: item.value,
-        choices: [],
-        code: item.sn,
-        multipleAnswers: item.isMultiple || false,
-        qKey: item.attr
-      };
-      let obj = {};
-      obj[item.sn] = {
-        type: item.type,
-        questionNo: item.sn,
-        multipleAnswers: item.isMultiple || false
-      };
-      try {
-        if (item.type === this.QUESTION_TYPE_COMBINATION) {
-          temp = item.children.map(this.formatItemVal);
-        } else if (item.type === this.QUESTION_TYPE_MATRIX) {
-          // let res = [];
-          // item.matrix.forEach((cols, k1) => {
-          //   cols.forEach((c, k2) => {
-          //     c && res.push(item.rows[k1].label + "" + item.columns[k2].label);
-          //   });
-          // });
-          // item.value = res;
-          // return res;
-          let matrixValue = [];
-          item.matrix.map((v, i) => {
-            v.map((vv, ii) => {
-              let obj = {};
-              if (vv) {
-                console.log(ii);
-                obj["xKey"] = item.rows[i].attr;
-                obj["xText"] = item.rows[i].label;
-                obj["yKey"] = item.columns[ii].attr;
-                obj["yText"] = item.columns[ii].label;
-                matrixValue.push(obj);
-              }
-            });
-          });
-          obj["matrixAnswers"] = matrixValue;
-        } else if (item.type == this.QUESTION_TYPE_CHECKBOX) {
-          const choices = item.choices
-            .map(v => {
-              return {
-                label: v.label,
-                attr: v.attr
-              };
-            })
-            .sort((a, b) => a - b);
-          let answer = item.value
-            ? item.value.map(v => {
-                return {
-                  value: choices[Number(v)].label,
-                  key: choices[Number(v)].attr
-                };
-              })
-            : [];
-          obj[item.sn]["checkboxAnswers"] = answer;
-          return obj;
-        } else if ((item.type = this.QUESTION_TYPE_RADIO)) {
-          const choices = item.choices.map(v => {
-            return {
-              label: v.label,
-              attr: v.attr
-            };
-          });
-          const answer =
-            item.value || item.value === 0
-              ? {
-                  key: choices[Number(item.value)].attr,
-                  value: choices[Number(item.value)].label
-                }
-              : null;
-          obj[item.sn]["answer"] = answer;
-        } else {
-          return obj;
-        }
-      } catch (error) {}
-      return obj;
-    }
-  }
-};
-
-// const len = (arg: any[] | string) => (typeof arg == 'number' ? arg : arg.length)
-
-// onMounted(() => {
-//   if ('scrollRestoration' in history) {
-//     history.scrollRestoration = 'manual'
-//   }
-//   inputBlur()
-//   init()
-// })
-</script>
-
-<style lang="scss">
-body {
-  overflow-x: hidden;
-}
-.home {
-  height: 100%;
-  overflow-x: hidden;
-  overflow-y: auto;
-  padding-bottom: 140px;
-  box-sizing: border-box;
-  .dialogue-list {
-    box-sizing: border-box;
-    padding-top: 20px;
-  }
-  .dialogue-item {
-    // display: flex;
-    // justify-content: flex-start;
-    // align-items: flex-start;
-    margin-bottom: 15px;
-    transition: all 0.3s linear;
-    transform: translateZ(0);
-  }
-  .survey-title {
-    font-size: 15px;
-  }
-  .survey-desc {
-    font-size: 12px;
-    color: #666;
-    margin-top: 5px;
-  }
-  .survey-tag {
-    position: absolute;
-    right: 0;
-    top: 0;
-    color: #fff;
-    padding: 4px 10px;
-    font-size: 12px;
-    border-radius: 0 10px 0 10px;
-    background: linear-gradient(to right, #fea36c 0%, #fb7654 100%);
-  }
-  .avatar {
-    border-radius: 4px;
-    width: 45px;
-    height: 45px;
-    margin: 0 10px;
-    overflow: hidden;
-    border-radius: 50%;
-  }
-  .dialogue-content {
-    max-width: 70%;
-    border-radius: 10px;
-    border-top-left-radius: 0;
-    background: #fff;
-    // box-shadow: 1px 1px 2px #ccc;
-    padding: 10px;
-    box-sizing: border-box;
-    position: relative;
-    img {
-      max-width: 100%;
-    }
-    .gender-select {
-      width: 180px;
-      padding: 20px 0 10px;
-      display: flex;
-      align-items: center;
-      justify-content: space-around;
-      .gender-item {
-        display: flex;
-        flex-direction: column;
-        justify-content: center;
-        align-items: center;
-        font-size: 14px;
-        color: #999;
-        cursor: pointer;
-        img {
-          border-radius: 50%;
-        }
-        span {
-          margin-top: 4px;
-        }
-        &.active {
-          img {
-            border: 1px solid #4b72f6;
-          }
-          span {
-            color: #4b72f6;
-          }
-        }
-      }
-    }
-    .link {
-      margin-top: 10px;
-    }
-    .confirm-btn {
-      min-width: 60%;
-      margin: 15px auto 0;
-      background: #4b72f6;
-    }
-    .confirm-input {
-      border-color: #dbe0ef;
-    }
-    .confirm-input-btn {
-      border-radius: 4px;
-    }
-    .answer-btn {
-      background: #f5f5f5;
-      border-radius: 4px;
-      border: 0;
-      display: block;
-      width: 100%;
-      padding: 8px 15px;
-      box-sizing: border-box;
-      position: relative;
-      cursor: pointer;
-      &:before {
-        content: "";
-        background: #4b72f6;
-        width: 4px;
-        height: 4px;
-        display: inline-block;
-        vertical-align: middle;
-        border-radius: 50%;
-        position: absolute;
-        left: 5px;
-        top: 50%;
-        margin-top: -2px;
-      }
-      &.active {
-        color: #4b72f6;
-        background: #edf2fe;
-      }
-    }
-  }
-  .cur-answer {
-    .dialogue-content {
-      border-top-left-radius: 10px;
-      border-top-right-radius: 0;
-      background: #4b72f6;
-      color: #fff;
-    }
-  }
-  .full-btn {
-    display: block;
-    background: #4b72f6;
-    border: 0;
-    color: #fff;
-    text-shadow: 1px 1px 1px #643d066c;
-    font-size: 16px;
-    letter-spacing: 2px;
-    cursor: pointer;
-    border-radius: 4px;
-    height: 40px;
-    line-height: 40px;
-    margin-top: 20px;
-  }
-}
-</style>

+ 0 - 754
src/views/schemeLibrary/checkitemLibrary.vue

@@ -1,754 +0,0 @@
-<template>
-  <div class="page-channel p-6">
-    <div class="h-full w-full flex">
-      <div class="mr-2">
-        <el-card shadow="never" class="h-full">
-          <template #header>
-            <div class="flex items-center justify-between">
-              <div class="flex items-center">
-                <el-input
-                  v-model.trim="query.name"
-                  clearable
-                  placeholder="输入机构名称进行搜索"
-                />
-                <el-button
-                  type="primary"
-                  class="ml-2"
-                  @click="onSearch"
-                  :icon="Search"
-                  >搜索</el-button
-                >
-              </div>
-              <el-button
-                type="primary"
-                :icon="Plus"
-                class="ml-2"
-                @click="
-                  editVisible = true;
-                  editForm = {
-                    id: undefined,
-                    name: '',
-                    comment: ''
-                  };
-                "
-                >新增</el-button
-              >
-            </div>
-          </template>
-          <div>
-            <el-table
-              :data="state.list"
-              class="w-full"
-              :show-header="false"
-              max-height="85vh"
-              @row-click="editRow"
-            >
-              <el-table-column prop="name" label="姓名">
-                <template #default="{ row }">
-                  <div
-                    class="p-2 hover:bg-gray-50 cursor-pointer rounded"
-                    :class="{
-                      'bg-gray-10 border-r-4 border-blue-500':
-                        currentValue?.id == row.id
-                    }"
-                  >
-                    <h3>{{ row.name }}</h3>
-                    <el-text>备注:{{ row.comment }}</el-text> <br />
-                    <el-text>最后更新时间:{{ row.updatedAt }}</el-text>
-                  </div>
-                </template>
-              </el-table-column>
-            </el-table>
-
-            <el-pagination
-              background
-              class="justify-end mt-4"
-              layout="total, prev, pager, next"
-              :page-size="10"
-              :total="state.total"
-              @change="handleCurrentChange"
-            />
-          </div>
-        </el-card>
-      </div>
-      <div class="flex-1 h-full">
-        <div v-if="currentValue?.id" class="h-full flex flex-col bg-white">
-          <div class="p-4 border-b border-solid border-gray-200">
-            <div class="flex items-center justify-between">
-              <div>
-                <h4>{{ currentValue.name }}</h4>
-                <el-text>使用范围:{{ currentValue.comment }}</el-text>
-              </div>
-              <div class="ml-8">
-                <el-button type="primary" :icon="Edit" link @click="handleEdit"
-                  >编辑</el-button
-                >
-                <el-popconfirm
-                  title="确定要删除这个机构吗?"
-                  width="300"
-                  @confirm="handleDelete"
-                >
-                  <template #reference>
-                    <el-button type="danger" :icon="Delete" link
-                      >删除</el-button
-                    >
-                  </template>
-                </el-popconfirm>
-              </div>
-            </div>
-          </div>
-          <div class="flex-1 p-4 overflow-y-auto">
-            <div class="flex items-center">
-              <el-button type="primary" @click="showEditCheckItem(null)"
-                >新增检查项目</el-button
-              >
-              <div class="flex flex-1 justify-end">
-                <el-input
-                  v-model="checkItem.query.name"
-                  class="w-64"
-                  placeholder="请输入检查项目名称"
-                  clearable
-                  @keyup.enter="
-                    checkItem.query.page = 1;
-                    getCheckItemList();
-                  "
-                />
-                <el-button
-                  type="primary"
-                  class="ml-2"
-                  @click="
-                    checkItem.query.page = 1;
-                    getCheckItemList();
-                  "
-                  >搜索</el-button
-                >
-              </div>
-            </div>
-            <el-table
-              :data="checkItem.list"
-              border
-              class="mt-4"
-              v-loading="checkItem.loading"
-              element-loading-text="加载中..."
-            >
-              <el-table-column label="检查项目名称" prop="name" />
-              <el-table-column label="检查项目类型">
-                <template #default="{ row }">
-                  {{ ["检验", "检查"][row.type - 1] }}
-                </template>
-              </el-table-column>
-              <el-table-column label="检查内容">
-                <template #default="{ row }">
-                  <div>
-                    {{ row.checkItems.map(v => v.name).join() }}
-                  </div>
-                </template>
-              </el-table-column>
-              <el-table-column label="操作" width="200">
-                <template #default="{ row }">
-                  <el-button
-                    type="primary"
-                    :icon="Edit"
-                    link
-                    @click="showEditCheckItem(row)"
-                    >编辑</el-button
-                  >
-                  <el-popconfirm
-                    title="确定要删除这个检查项目吗?"
-                    width="300"
-                    @confirm="handleDeleteCheckItem(row)"
-                  >
-                    <template #reference>
-                      <el-button type="danger" :icon="Delete" link
-                        >删除</el-button
-                      >
-                    </template>
-                  </el-popconfirm>
-                </template>
-              </el-table-column></el-table
-            >
-
-            <el-pagination
-              background
-              class="justify-end mt-4"
-              layout="total, prev, pager, next"
-              v-model:current-page="checkItem.query.page"
-              :total="checkItem.total"
-              @current-change="
-                p => {
-                  checkItem.query.page = p;
-                  getCheckItemList();
-                }
-              "
-            />
-          </div>
-        </div>
-        <el-card shadow="never" class="h-full" v-else>
-          <div>
-            <el-empty />
-          </div>
-        </el-card>
-      </div>
-    </div>
-
-    <el-dialog title="检查机构管理" v-model="editVisible">
-      <div>
-        <el-form ref="formRef" :model="editForm" label-width="120px">
-          <el-form-item
-            label="检查机构名称:"
-            prop="name"
-            :rules="[
-              {
-                required: true,
-                message: '请输入机构名称',
-                trigger: 'blur'
-              }
-            ]"
-          >
-            <el-input
-              v-model="editForm.name"
-              placeholder="请输入机构名称"
-              clearable
-            />
-          </el-form-item>
-          <el-form-item label="备注:" prop="comment">
-            <el-input
-              v-model="editForm.comment"
-              placeholder="请输入备注"
-              clearable
-            />
-          </el-form-item>
-        </el-form>
-      </div>
-      <template #footer>
-        <div>
-          <el-button @click="editVisible = false">取 消</el-button>
-          <el-button type="primary" @click="saveEditTemplate">保 存</el-button>
-        </div>
-      </template>
-    </el-dialog>
-    <el-dialog
-      v-model="editCheckItem.visible"
-      title="检查项目编辑"
-      :close-on-press-escape="false"
-      :close-on-click-modal="false"
-      destroy-on-close
-      width="80%"
-    >
-      <el-form>
-        <el-form-item label="检查项目名称">
-          <el-input v-model="editCheckItem.row.name" />
-        </el-form-item>
-        <el-form-item label="系统体检项目">
-          <el-select
-            v-model="editCheckItem.row.systemCheck"
-            placeholder="请选择"
-            filterable
-          >
-            <el-option
-              v-for="item in editCheckItem.systemCheckList"
-              :key="item.id"
-              :label="item.label"
-              :value="item.id"
-            />
-          </el-select>
-        </el-form-item>
-        <el-form-item label="检查项目类型">
-          <el-select v-model="editCheckItem.row.type" placeholder="请选择">
-            <el-option label="检验" :value="1" />
-            <el-option label="检查" :value="2" />
-          </el-select>
-        </el-form-item>
-        <el-form-item label="检查内容">
-          <el-button
-            type="primary"
-            plain
-            :icon="Plus"
-            @click="
-              state.massAddvisible = true;
-              state.content = '';
-            "
-            >批量添加</el-button
-          >
-        </el-form-item>
-      </el-form>
-      <el-table :data="editCheckItem.row.checkItems">
-        <el-table-column
-          :label="editCheckItem.row.type == 1 ? '检验项目名称' : '检验项目名称'"
-        >
-          <template #default="{ row }">
-            <el-input v-model="row.name" placeholder="请输入" />
-          </template>
-        </el-table-column>
-        <template v-if="editCheckItem.row.type == 1">
-          <el-table-column label="单位">
-            <template #default="{ row }">
-              <el-input v-model="row.unit" placeholder="请输入" />
-            </template>
-          </el-table-column>
-          <el-table-column label="参考范围">
-            <template #default="{ row }">
-              <el-input v-model="row.scope" placeholder="请输入" /> </template
-          ></el-table-column>
-        </template>
-
-        <el-table-column label="排序">
-          <template #default="{ row }">
-            <el-input v-model.number="row.sort" placeholder="请输入" />
-          </template>
-        </el-table-column>
-
-        <el-table-column
-          v-for="(col, colIdx) in editCheckItem.row.type == 1
-            ? ['系统身体物质/部位', '系统检查项目']
-            : ['系统检查项目', '系统身体物质/部位']"
-          :label="col"
-        >
-          <template #default="{ row, $index }">
-            <template v-if="col == '系统身体物质/部位'">
-              <el-select
-                v-model="row.node"
-                :disabled="editCheckItem.row.type == 2 && !row.matchProject"
-                placeholder="请输入搜索后选择"
-                filterable
-                clearable
-                collapse-tags
-                remote
-                :class="{
-                  'no-match': !row.node
-                }"
-                :multiple="editCheckItem.row.type == 2"
-                :remote-method="
-                  query =>
-                    editCheckItem.row.type == 1 && searchBodyNodes(query, row)
-                "
-                @change="matchNodeChange(row)"
-                @clear="matchNodeClear(row)"
-              >
-                <el-option
-                  v-for="(project, projectIdx) in row.nodes"
-                  :key="project.id"
-                  :label="project.label"
-                  :value="project.id"
-                  class="h-auto"
-                >
-                  <div class="">
-                    <div>{{ project.label }}</div>
-                    <div v-if="project.matched" class="text-gray-500 text-xs">
-                      匹配名称:{{ project.matched }}
-                    </div>
-                  </div>
-                </el-option>
-              </el-select>
-            </template>
-            <template v-else>
-              <el-select
-                v-model="row.matchProject"
-                :disabled="editCheckItem.row.type == 1 && !row.nodes.length"
-                placeholder="请输入搜索后选择"
-                filterable
-                clearable
-                remote
-                :class="{
-                  'no-match': !row.matchProject
-                }"
-                :remote-method="query => searchOcrIndicator(query, row)"
-                @change="matchProjectChange(row)"
-                @clear="matchProjectClear(row)"
-              >
-                <el-option
-                  v-for="(project, projectIdx) in row.indicators"
-                  :key="project.id"
-                  :label="project.label"
-                  :value="project.id"
-                  class="h-auto"
-                >
-                  <div class="">
-                    <div>{{ project.label }}</div>
-                    <div v-if="project.matched" class="text-gray-500 text-xs">
-                      匹配名称:{{ project.matched }}
-                    </div>
-                  </div>
-                </el-option>
-              </el-select>
-            </template>
-          </template></el-table-column
-        >
-
-        <el-table-column label="操作">
-          <template #default="{ row, $index }">
-            <el-button
-              type="danger"
-              link
-              @click="editCheckItem.row.checkItems.splice($index, 1)"
-            >
-              删除
-            </el-button>
-          </template>
-        </el-table-column>
-      </el-table>
-      <div>
-        <el-button
-          type="primary"
-          link
-          class="mt-2"
-          @click="addEditCheckItemLine"
-        >
-          + 新增一行</el-button
-        >
-      </div>
-      <template #footer>
-        <el-button type="primary" @click="saveEditCheckItem">保存</el-button>
-      </template>
-    </el-dialog>
-    <el-dialog title="" v-model="state.massAddvisible" width="50%">
-      <div>
-        <el-input
-          type="textarea"
-          v-model="state.content"
-          :rows="18"
-          placeholder="输入检查内容,多个检查内容之间用中文输入法下的分号或顿号区隔"
-        />
-      </div>
-      <template #footer>
-        <el-button @click="state.massAddvisible = false">取 消</el-button>
-        <el-button type="primary" @click="handleMassAddContent"
-          >确 定</el-button
-        >
-      </template>
-    </el-dialog>
-  </div>
-</template>
-<script setup>
-import { ref, reactive } from "vue";
-import { Search, Plus, Edit, Delete } from "@element-plus/icons-vue";
-
-import { request, unique } from "@/utils";
-import { ElMessage } from "element-plus";
-
-const state = reactive({
-  visible: false,
-  list: [],
-  total: 0,
-  rowData: {},
-  content: "",
-  massAddvisible: false
-});
-const query = reactive({
-  title: "",
-  page: 1
-});
-
-const onSearch = () => {
-  query.page = 1;
-  getList();
-};
-const getList = async () => {
-  const { data } = await request.get(
-    "dataService/schemeManage/medicalCheck/hospital/paginate",
-    { params: query }
-  );
-  state.list = data.list;
-  state.total = data.total;
-  if (query.page == 1 && data.list[0]) {
-    editRow(data.list[0]);
-  }
-};
-const handleCurrentChange = page => {
-  query.page = page;
-  getList();
-};
-const handleDelete = async () => {
-  const { message } = await request.post(
-    `dataService/schemeManage/medicalCheck/hospital/delete`,
-    {
-      id: currentValue.value.id
-    }
-  );
-  ElMessage.success(message);
-  getList();
-};
-getList();
-
-const editRow = row => {
-  currentValue.value = row;
-  checkItem.query.hospitalId = row.id;
-  getCheckItemList();
-};
-const editForm = ref({
-  id: "",
-  name: "",
-  comment: ""
-});
-const editVisible = ref(false);
-const currentValue = ref({
-  id: ""
-});
-
-const handleEdit = () => {
-  editForm.value = currentValue.value;
-  editVisible.value = true;
-};
-const saveEditTemplate = async () => {
-  const { message } = await request.post(
-    `dataService/schemeManage/medicalCheck/hospital${
-      editForm.value.id ? "/update" : ""
-    }`,
-    editForm.value
-  );
-  ElMessage.success(message);
-  editVisible.value = false;
-  if (!editForm.value.id) {
-    onSearch();
-  }
-  getList();
-};
-
-const checkItem = reactive({
-  query: {
-    hospitalId: "",
-    name: "",
-    page: 1
-  },
-  list: [],
-  total: 0,
-  rowData: {}
-});
-const editCheckItem = reactive({
-  visible: false,
-  systemCheckList: [],
-  row: {
-    id: undefined,
-    name: "",
-    systemCheck: "",
-    type: 1,
-    checkItems: []
-  }
-});
-
-const relatedRelationship = ["异常属于", "可检测"];
-const getCheckItemList = async () => {
-  const { data } = await request.get(
-    "dataService/schemeManage/medicalCheck/item/paginate",
-    { params: checkItem.query }
-  );
-  checkItem.list = data.list || [];
-  checkItem.total = data.total;
-};
-const showEditCheckItem = async row => {
-  if (row) {
-    editCheckItem.row = row;
-  } else {
-    editCheckItem.row = {
-      id: undefined,
-      name: "",
-      systemCheck: "",
-      type: 1,
-      checkItems: []
-    };
-  }
-  editCheckItem.visible = true;
-  editCheckItem.systemCheckList = await getNodes({
-    tag: "体检项目"
-  });
-};
-const getNodes = async (query = {}) => {
-  const { data } = await request.get(`/graphService/open/node/paginate`, {
-    params: {
-      page: 1,
-      pageSize: 9999,
-      ...query
-    }
-  });
-  return (data.list || [])
-    .map(v => {
-      return {
-        id: v.id,
-        label: v.properties.name
-      };
-    })
-    .sort((a, b) => a.label?.length - b.label?.length);
-};
-
-const addEditCheckItemLine = () => {
-  editCheckItem.row.checkItems.push({
-    name: "",
-    unit: "",
-    scope: "",
-    sort: "",
-    node: "",
-    nodes: [],
-    matchProject: [],
-    indicators: []
-  });
-};
-const deleteEditCheckItemLine = index => {
-  editCheckItem.row.checkItems.splice(index, 1);
-};
-const saveEditCheckItem = async () => {
-  console.log(editCheckItem);
-  // return
-  const { message } = await request.post(
-    `dataService/schemeManage/medicalCheck/item${
-      editCheckItem.row.id ? "/update" : ""
-    }`,
-    {
-      ...editCheckItem.row,
-      hospitalId: checkItem.query.hospitalId
-    }
-  );
-  ElMessage.success(message);
-  editCheckItem.visible = false;
-  getCheckItemList();
-};
-const handleDeleteCheckItem = async row => {
-  const { message } = await request.post(
-    `dataService/schemeManage/medicalCheck/item/delete`,
-    {
-      id: row.id,
-      hospitalId: checkItem.query.hospitalId
-    }
-  );
-  ElMessage.success(message);
-  getCheckItemList();
-};
-
-const searchRelateNodes = async (id, relationship, query = {}) => {
-  const { data } = await request.get(`/graphService/open/node/related`, {
-    params: { id, relationship: relatedRelationship[relationship], ...query }
-  });
-  return (data || [])
-    .map(v => {
-      return {
-        id: v.id,
-        label: v.properties.name
-      };
-    })
-    .sort((a, b) => a.label?.length - b.label?.length);
-};
-const searchBodyNodes = async (key, row) => {
-  if (!key) return;
-  const nodes =
-    (await getNodes({
-      name: key,
-      tag: "身体物质/部位"
-    })) || [];
-  const dataIds = nodes.map(v => v.id);
-  console.log(row);
-  const findItem = row.nodes.find(v => v.id == row.node);
-  row.nodes =
-    findItem && !dataIds.includes(findItem.id) ? [findItem, ...nodes] : nodes;
-};
-const matchNodeChange = async row => {
-  console.log(row);
-  // console.log(item, row, item.nodes[rowIdx]);
-  const appendChildren = [];
-  if (editCheckItem.row.type == 1) {
-    const curNode = row.nodes.find(v => row.node == v.id);
-    const projects = await searchRelateNodes(row.node, 1);
-    row.matchProject = "";
-    row.indicators = projects;
-  }
-  if (editCheckItem.row.type == 2) {
-    const curNodes = row.node.filter(v => {
-      const curNode = row.nodes.find(v2 => v == v2.id);
-      return (
-        curNode.properties["类型编号"] &&
-        Number(curNode.properties["类型编号"][0]) == 0
-      );
-    });
-    console.log(curNodes);
-    if (curNodes?.length) {
-      const data = await searchRelateNodes(curNodes.join(","), 0);
-      data.length &&
-        appendChildren.push({
-          id: row.node,
-          abnormal: data
-        });
-    }
-  }
-};
-const matchNodeClear = row => {
-  if (editCheckItem.row.type == 1) {
-    row.nodes = [];
-    row.matchProject = "";
-    row.indicators = [];
-  }
-};
-const searchOcrIndicator = async (key, row) => {
-  if (!key) return;
-  const nodes =
-    (await getNodes({
-      name: key,
-      tag: "医学检查项目"
-    })) || [];
-  const dataIds = nodes.map(v => v.id);
-  const findItem = row.indicators.find(v => v.id == row.matchProject);
-  row.indicators =
-    findItem && !dataIds.includes(findItem.id) ? [findItem, ...nodes] : nodes;
-};
-const matchProjectChange = async row => {
-  if (editCheckItem.row.type == 2) {
-    console.log(row);
-    const nodes = await searchRelateNodes(row.matchProject, 1);
-    row.node = [];
-    row.nodes = nodes;
-  }
-};
-const matchProjectClear = (item, rowIdx) => {
-  if (editCheckItem.row.type == 2) {
-    row.node = [];
-    row.nodes = [];
-    row.matchProject = "";
-    row.indicators = [];
-  }
-};
-const handleMassAddContent = () => {
-  try {
-    const contentArray = state.content
-      .replaceAll(";", "、")
-      .split("、")
-      .filter(v => v);
-
-    const array = [];
-    contentArray.map(v => {
-      array.push({
-        name: v,
-        unit: "",
-        scope: "",
-        sort: "",
-        node: "",
-        nodes: [],
-        matchProject: [],
-        indicators: []
-      });
-    });
-    // 去重
-    editCheckItem.row.checkItems = unique(
-      [...editCheckItem.row.checkItems, ...array],
-      "name"
-    );
-  } catch (error) {
-    ElMessage.error(error);
-  } finally {
-    state.massAddvisible = false;
-  }
-};
-</script>
-<style lang="scss">
-.el-scrollbar__view {
-  height: 100%;
-  .main-content.page-channel {
-    height: 100%;
-    margin: 0;
-  }
-}
-::v-deep {
-  .el-card__header {
-    height: 74px;
-  }
-  .el-table .el-table__body tr:hover > td {
-    background-color: transparent;
-  }
-}
-</style>

+ 0 - 119
src/views/schemeLibrary/components/DialogEditDiseaseGrade.vue

@@ -1,119 +0,0 @@
-<template>
-  <div>
-    <el-dialog title="管理级别设置" v-model="dialogVisible">
-      <div>
-        <el-form ref="formRef" :model="form" label-width="120px">
-          <el-form-item label="慢病管理级别:" prop="title">
-            <el-text tag="b">{{ form.title }}</el-text>
-          </el-form-item>
-          <el-form-item
-            label="适用人群:"
-            prop="scope"
-            :rules="[
-              {
-                required: true,
-                message: '请输入适用人群',
-                trigger: 'blur'
-              }
-            ]"
-          >
-            <el-input
-              v-model="form.scope"
-              placeholder="请输入适用人群"
-              clearable
-              type="textarea"
-              :rows="8"
-            ></el-input>
-          </el-form-item>
-          <el-form-item
-            label="介绍信息:"
-            prop="content"
-            :rules="[
-              {
-                required: true,
-                message: '请输入该级别介绍信息',
-                trigger: 'blur'
-              }
-            ]"
-          >
-            <el-input
-              v-model="form.content"
-              placeholder="请输入该级别介绍信息"
-              clearable
-              type="textarea"
-              :rows="8"
-            ></el-input>
-          </el-form-item>
-        </el-form>
-      </div>
-      <template #footer>
-        <div>
-          <el-button @click="dialogVisible = false">取 消</el-button>
-          <el-button type="primary" @click="onSubmit">保 存</el-button>
-        </div>
-      </template>
-    </el-dialog>
-  </div>
-</template>
-<script lang="ts" setup>
-import { request } from "@/utils";
-import { ElMessage } from "element-plus";
-import { ref, computed, defineProps, defineEmits, watch, reactive } from "vue";
-import Editor from "@/components/Editor.vue";
-
-const props = defineProps({
-  show: {
-    type: Boolean,
-    default: false
-  },
-  rowData: {
-    type: Object,
-    default: () => {}
-  }
-});
-const emits = defineEmits(["update:show", "success"]);
-const dialogVisible = computed({
-  get() {
-    return props.show;
-  },
-  set(n) {
-    emits("update:show", n);
-  }
-});
-
-watch(
-  () => dialogVisible.value,
-  n => {
-    if (n) {
-      if (props.rowData?.id) {
-        form.title = props.rowData.title;
-        form.scope = props.rowData.scope;
-        form.id = props.rowData.id;
-        form.content = props.rowData.content;
-      }
-    } else {
-      formRef.value.resetFields();
-      form.id = undefined;
-    }
-  }
-);
-const form = reactive({
-  title: "",
-  scope: "",
-  content: "",
-  id: undefined
-});
-const formRef = ref();
-
-const onSubmit = () => {
-  formRef.value.validate(valid => {
-    if (!valid) return;
-    let api = "dataService/schemeManage/diseaseManageLevel/update";
-    request.post(api, form).then(resp => {
-      ElMessage.success(resp.message);
-      dialogVisible.value = false;
-      emits("success");
-    });
-  });
-};
-</script>

+ 0 - 192
src/views/schemeLibrary/components/DialogEditDiseaseManageGroup.vue

@@ -1,192 +0,0 @@
-<template>
-  <div>
-    <el-dialog title="分组管理" v-model="dialogVisible">
-      <div>
-        <el-form ref="formRef" :model="form" label-width="120px">
-          <el-form-item
-            label="分组名称:"
-            prop="name"
-            :rules="[
-              {
-                required: true,
-                message: '请输入管理分组名称',
-                trigger: 'blur'
-              }
-            ]"
-          >
-            <el-input
-              v-model="form.name"
-              placeholder="请输入"
-              clearable
-            ></el-input>
-          </el-form-item>
-          <el-form-item label="适用人群:" prop="scope">
-            <el-input
-              v-model="form.scope"
-              placeholder="请输入该分组适用人群范围,如高血压高危分层人群"
-              clearable
-            ></el-input>
-          </el-form-item>
-          <el-form-item label="对应疾病:" prop="diseases">
-            <el-select
-              multiple
-              v-model="form.diseases"
-              placeholder="全部已确诊疾病"
-              filterable
-              :remote-method="getNodeList"
-              :loading="loading"
-              remote
-              reserve-keyword
-              clearable
-              style="width: 200px"
-              class="mr-2"
-            >
-              <el-option
-                v-for="item in nodeList"
-                :key="item.id"
-                :label="item.properties?.name"
-                :value="item.value"
-              ></el-option>
-            </el-select>
-          </el-form-item>
-        </el-form>
-      </div>
-      <template #footer>
-        <div>
-          <el-button @click="dialogVisible = false">取 消</el-button>
-          <el-button type="primary" @click="onSubmit">保 存</el-button>
-        </div>
-      </template>
-    </el-dialog>
-  </div>
-</template>
-<script lang="ts" setup>
-import { request } from "@/utils";
-import { ElMessage } from "element-plus";
-import { ref, computed, defineProps, defineEmits, watch, reactive } from "vue";
-import { cloneDeep } from "@pureadmin/utils";
-
-const props = defineProps({
-  show: {
-    type: Boolean,
-    default: false
-  },
-  rowData: {
-    type: Object,
-    default: () => {}
-  },
-  levelId: {
-    type: [Number, String],
-    default: ""
-  }
-});
-const emits = defineEmits(["update:show", "success"]);
-const dialogVisible = computed({
-  get() {
-    return props.show;
-  },
-  set(n) {
-    emits("update:show", n);
-  }
-});
-
-watch(
-  () => dialogVisible.value,
-  n => {
-    if (n) {
-      if (props.rowData?.id) {
-        form.name = props.rowData.name;
-        form.scope = props.rowData.scope;
-        form.id = props.rowData.id;
-        let deepcloneDiseases = cloneDeep(props.rowData?.diseases);
-        form.diseases = deepcloneDiseases?.map(v => JSON.stringify(v));
-
-        nodeList.value = deepcloneDiseases?.map(v => {
-          return {
-            ...v,
-            value: JSON.stringify(v)
-          };
-        });
-
-        console.log("nodeList", nodeList.value);
-        console.log("form.diseases", form.diseases);
-      }
-    } else {
-      formRef.value.resetFields();
-      form.id = undefined;
-    }
-  }
-);
-const form = reactive({
-  name: "",
-  scope: "",
-  id: undefined,
-  diseases: []
-});
-const loading = ref(false);
-const nodeList = ref([]);
-const formRef = ref();
-
-const onSubmit = () => {
-  formRef.value.validate(valid => {
-    if (!valid) return;
-    console.log("form.diseases", form.diseases);
-
-    let api = form.id
-      ? "dataService/schemeManage/diseaseManageGroup/update"
-      : "dataService/schemeManage/diseaseManageGroup";
-    request
-      .post(api, {
-        ...form,
-        levelid: props.levelId,
-        diseases: form.diseases.map(v => JSON.parse(v))
-      })
-      .then(resp => {
-        ElMessage.success(resp.message);
-        dialogVisible.value = false;
-        emits("success");
-      });
-  });
-};
-
-const getNodeList = (query: string) => {
-  if (!query) {
-    return (nodeList.value = []);
-  }
-  loading.value = true;
-
-  request
-    .get("/platformApi/graphService/open/node/paginate", {
-      params: {
-        pageSize: 10,
-        tag: "疾病",
-        name: query
-      }
-    })
-    .then(resp => {
-      let list = resp.data.list;
-      nodeList.value = list.map(v => {
-        return {
-          ...v,
-          // key排序 不然的话key会无序
-          value: JSON.stringify(v, (key, value) => {
-            if (typeof value === "object" && !Array.isArray(value)) {
-              return Object.keys(value)
-                .sort()
-                .reduce((sorted, key) => {
-                  sorted[key] = value[key];
-                  return sorted;
-                }, {});
-            }
-            return value;
-          })
-        };
-      });
-      console.log("list", nodeList.value);
-    })
-    .finally(() => {
-      loading.value = false;
-    });
-};
-// getNodeList();
-</script>

+ 0 - 130
src/views/schemeLibrary/components/DialogEditSuggestion.vue

@@ -1,130 +0,0 @@
-<template>
-  <div>
-    <el-dialog title="健康建议模板" v-model="dialogVisible">
-      <div>
-        <el-form ref="formRef" :model="form" label-width="120px">
-          <el-form-item
-            label="标题:"
-            prop="title"
-            :rules="[
-              {
-                required: true,
-                message: '请输入模板标题',
-                trigger: 'blur'
-              }
-            ]"
-          >
-            <el-input
-              v-model="form.title"
-              placeholder="请输入模板标题"
-              clearable
-            ></el-input>
-          </el-form-item>
-          <el-form-item
-            label="适用范围:"
-            prop="scope"
-            :rules="[
-              {
-                required: true,
-                message: '请输入适用范围',
-                trigger: 'blur'
-              }
-            ]"
-          >
-            <el-input
-              v-model="form.scope"
-              placeholder="请输入适用范围"
-              clearable
-            ></el-input>
-          </el-form-item>
-          <el-form-item
-            label="内容:"
-            prop="content"
-            :rules="[
-              {
-                required: true,
-                message: '请输入内容',
-                trigger: 'blur'
-              }
-            ]"
-          >
-            <Editor v-model:value="form.content"></Editor>
-          </el-form-item>
-        </el-form>
-      </div>
-      <template #footer>
-        <div>
-          <el-button @click="dialogVisible = false">取 消</el-button>
-          <el-button type="primary" @click="onSubmit">保 存</el-button>
-        </div>
-      </template>
-    </el-dialog>
-  </div>
-</template>
-<script lang="ts" setup>
-import { request } from "@/utils";
-import { ElMessage } from "element-plus";
-import { ref, computed, defineProps, defineEmits, watch, reactive } from "vue";
-import Editor from "@/components/Editor.vue";
-import { nextTick } from "process";
-
-const props = defineProps({
-  show: {
-    type: Boolean,
-    default: false
-  },
-  rowData: {
-    type: Object,
-    default: () => {}
-  }
-});
-const emits = defineEmits(["update:show", "success"]);
-const dialogVisible = computed({
-  get() {
-    return props.show;
-  },
-  set(n) {
-    emits("update:show", n);
-  }
-});
-
-watch(
-  () => dialogVisible.value,
-  n => {
-    if (n) {
-      if (props.rowData?.id) {
-        nextTick(() => {
-          form.title = props.rowData.title;
-          form.scope = props.rowData.scope;
-          form.id = props.rowData.id;
-          form.content = props.rowData.content;
-        });
-      }
-    } else {
-      formRef.value.resetFields();
-      form.id = undefined;
-    }
-  }
-);
-const form = reactive({
-  title: "",
-  scope: "",
-  content: "",
-  id: undefined
-});
-const formRef = ref();
-
-const onSubmit = () => {
-  formRef.value.validate(valid => {
-    if (!valid) return;
-    let api = form.id
-      ? "dataService/schemeManage/healthAdvise/update"
-      : "dataService/schemeManage/healthAdvise";
-    request.post(api, form).then(resp => {
-      ElMessage.success(resp.message);
-      dialogVisible.value = false;
-      emits("success");
-    });
-  });
-};
-</script>

+ 0 - 101
src/views/schemeLibrary/components/DialogEditTags.vue

@@ -1,101 +0,0 @@
-<template>
-  <div>
-    <el-dialog title="标签管理" v-model="dialogVisible">
-      <div>
-        <el-form ref="formRef" :model="form" label-width="120px">
-          <el-form-item
-            label="标题:"
-            prop="name"
-            :rules="[
-              {
-                required: true,
-                message: '请输入标签名称',
-                trigger: 'blur'
-              }
-            ]"
-          >
-            <el-input
-              v-model="form.name"
-              placeholder="请输入"
-              clearable
-            ></el-input>
-          </el-form-item>
-          <el-form-item label="标签用途:" prop="purpose">
-            <el-input
-              v-model="form.purpose"
-              placeholder="请输入标签用途"
-              clearable
-            ></el-input>
-          </el-form-item>
-        </el-form>
-      </div>
-      <template #footer>
-        <div>
-          <el-button @click="dialogVisible = false">取 消</el-button>
-          <el-button type="primary" @click="onSubmit">保 存</el-button>
-        </div>
-      </template>
-    </el-dialog>
-  </div>
-</template>
-<script lang="ts" setup>
-import { request } from "@/utils";
-import { ElMessage } from "element-plus";
-import { ref, computed, defineProps, defineEmits, watch, reactive } from "vue";
-
-const props = defineProps({
-  show: {
-    type: Boolean,
-    default: false
-  },
-  rowData: {
-    type: Object,
-    default: () => {}
-  }
-});
-const emits = defineEmits(["update:show", "success"]);
-const dialogVisible = computed({
-  get() {
-    return props.show;
-  },
-  set(n) {
-    emits("update:show", n);
-  }
-});
-
-watch(
-  () => dialogVisible.value,
-  n => {
-    if (n) {
-      if (props.rowData?.id) {
-        form.name = props.rowData.name;
-        form.purpose = props.rowData.purpose;
-        form.id = props.rowData.id;
-      }
-    } else {
-      formRef.value.resetFields();
-      form.id = undefined;
-    }
-  }
-);
-const form = reactive({
-  name: "",
-  purpose: "",
-  id: undefined
-});
-const formRef = ref();
-
-const onSubmit = () => {
-  formRef.value.validate(valid => {
-    if (!valid) return;
-    let api = form.id
-      ? "dataService/schemeManage/tag/update"
-      : "dataService/schemeManage/tag";
-    request.post(api, form).then(resp => {
-      ElMessage.success(resp.message);
-      dialogVisible.value = false;
-      emits("success");
-    });
-  });
-};
-</script>

+ 0 - 210
src/views/schemeLibrary/index.vue

@@ -1,210 +0,0 @@
-<template>
-  <div class="page-channel">
-    <el-row :gutter="10" style="height: 90vh">
-      <el-col :span="6">
-        <el-card shadow="never" class="h-full">
-          <template #header>
-            <div class="flex items-center justify-between">
-              <div class="flex items-center">
-                <el-input
-                  v-model.trim="query.title"
-                  clearable
-                  placeholder="输入标题名称进行搜索"
-                />
-                <el-button
-                  type="primary"
-                  class="ml-2"
-                  @click="onSearch"
-                  :icon="Search"
-                  >搜索</el-button
-                >
-              </div>
-              <Auth value="healthManage:suggestion:edit">
-                <el-button
-                  type="primary"
-                  :icon="Plus"
-                  class="ml-2"
-                  @click="
-                    state.visible = true;
-                    state.rowData = {
-                      id: undefined
-                    };
-                  "
-                  >新增</el-button
-                >
-              </Auth>
-            </div>
-          </template>
-          <div>
-            <el-table
-              :data="state.list"
-              style="width: 100%"
-              :show-header="false"
-              max-height="85vh"
-              @row-click="
-                row => {
-                  state.currentValue = row;
-                }
-              "
-            >
-              <el-table-column prop="name" label="姓名">
-                <template #default="{ row }">
-                  <div
-                    :class="state.currentValue.id == row.id && 'active'"
-                    class="p-2 left-wrapper cursor-pointer"
-                  >
-                    <h3>{{ row.title }}</h3>
-                    <el-text>适用范围:{{ row.scope }}</el-text> <br />
-                    <el-text>最后更新时间:{{ row.updatedAt }}</el-text>
-                  </div>
-                </template>
-              </el-table-column>
-            </el-table>
-
-            <el-pagination
-              background
-              class="justify-end mt-4"
-              layout="total, prev, pager, next"
-              :page-size="10"
-              :total="state.total"
-              @change="handleCurrentChange"
-            />
-          </div>
-        </el-card>
-      </el-col>
-      <el-col :span="18">
-        <el-card shadow="never" v-if="state.currentValue.id" class="h-full">
-          <template #header>
-            <div class="flex items-center justify-between">
-              <div>
-                <h4>{{ state.currentValue.title }}</h4>
-                <el-text>使用范围:{{ state.currentValue.scope }}</el-text>
-              </div>
-              <div class="ml-8">
-                <Auth value="healthManage:suggestion:edit">
-                  <el-button
-                    type="primary"
-                    :icon="Edit"
-                    link
-                    @click="handleEdit"
-                    >编辑</el-button
-                  >
-                  <el-popconfirm
-                    title="确定要删除这个模板吗?"
-                    width="300"
-                    @confirm="handleDelete"
-                  >
-                    <template #reference>
-                      <el-button type="danger" :icon="Delete" link
-                        >删除</el-button
-                      >
-                    </template>
-                  </el-popconfirm>
-                </Auth>
-              </div>
-            </div>
-          </template>
-          <div>
-            <!-- <PageDepartment
-              :channelId="state.currentValue.id"
-              :channelName="state.currentValue.name"
-            ></PageDepartment> -->
-            <div v-html="state.currentValue.content" />
-          </div>
-        </el-card>
-        <el-card shadow="never" class="h-full" v-else>
-          <div>
-            <el-empty />
-          </div>
-        </el-card>
-      </el-col>
-    </el-row>
-    <DialogEditSuggestion
-      v-model:show="state.visible"
-      @success="onSearch"
-      :rowData="state.rowData"
-    />
-  </div>
-</template>
-<script lang="ts" setup>
-import { reactive } from "vue";
-import { Search, Plus, Edit, Delete } from "@element-plus/icons-vue";
-import DialogEditSuggestion from "./components/DialogEditSuggestion.vue";
-
-import { request } from "@/utils";
-import { ElMessage } from "element-plus";
-
-const state = reactive({
-  visible: false,
-  list: [],
-  total: 0,
-  currentValue: {
-    id: undefined,
-    name: ""
-  },
-  rowData: {}
-});
-const query = reactive({
-  title: "",
-  page: 1
-});
-const initcurrentValue = () => {
-  state.currentValue.id = "";
-  state.currentValue.name = "";
-};
-const onSearch = () => {
-  query.page = 1;
-  getList();
-};
-const getList = () => {
-  request
-    .get("dataService/schemeManage/healthAdvise/paginate", { params: query })
-    .then(resp => {
-      state.list = resp.data.list;
-      state.total = resp.data.total;
-      if (state.currentValue.id) {
-        state.currentValue = state.list.find(
-          v => v.id == state.currentValue.id
-        );
-      }
-    });
-};
-const handleCurrentChange = page => {
-  query.page = page;
-  getList();
-};
-const handleEdit = () => {
-  state.rowData = state.currentValue;
-  state.visible = true;
-};
-const handleDelete = () => {
-  request
-    .post(`dataService/schemeManage/healthAdvise/delete`, {
-      id: state.currentValue.id
-    })
-    .then(resp => {
-      ElMessage.success(resp.message);
-      initcurrentValue();
-      getList();
-    });
-};
-getList();
-</script>
-<style lang="scss" scoped>
-.active {
-  // color: var(--el-color-primary);
-  background-color: #f5f7fa;
-  border-right: 6px solid var(--el-color-primary);
-}
-::v-deep {
-  .el-card__header {
-    height: 74px;
-  }
-  .el-table .el-table__body tr:hover > td {
-    background-color: transparent;
-  }
-}
-.left-wrapper:hover {
-  background-color: #f5f7fa;
-}
-</style>

+ 0 - 261
src/views/schemeLibrary/managementGroupBase.vue

@@ -1,261 +0,0 @@
-<template>
-  <div class="page-channel">
-    <el-row :gutter="10" style="height: 90vh">
-      <el-col :span="6">
-        <el-card shadow="never" class="h-full">
-          <template #header>
-            <h3 class="text-center">慢病管理级别</h3>
-          </template>
-          <div>
-            <el-table
-              :data="state.list"
-              style="width: 100%"
-              :show-header="false"
-              max-height="85vh"
-              @row-click="
-                row => {
-                  state.currentValue = row;
-                  getGroupList();
-                }
-              "
-            >
-              <el-table-column prop="name" label="姓名">
-                <template #default="{ row }">
-                  <div
-                    :class="state.currentValue.id == row.id && 'active'"
-                    class="p-2 left-wrapper cursor-pointer"
-                  >
-                    <h3>{{ row.title }}</h3>
-                    <span class="text-sm text-yellow-600"
-                      >适用人群:{{ row.scope }}</span
-                    >
-                    <br />
-                    <el-text class="text-sm">{{ row.content }}</el-text>
-                  </div>
-                </template>
-              </el-table-column>
-            </el-table>
-          </div>
-        </el-card>
-      </el-col>
-      <el-col :span="18">
-        <el-card shadow="never" v-if="state.currentValue.id" class="h-full">
-          <template #header>
-            <div class="flex items-center justify-between">
-              <div class="flex items-center">
-                <h4 class="mr-4">{{ state.currentValue.title }}</h4>
-                <Auth value="healthManage:group:edit">
-                  <el-button
-                    type="primary"
-                    :icon="Edit"
-                    link
-                    @click="handleEdit"
-                    >编辑</el-button
-                  >
-                </Auth>
-              </div>
-              <div class="ml-8">
-                <div class="flex items-center">
-                  <el-input
-                    v-model.trim="query.name"
-                    clearable
-                    placeholder="输入分组名称进行搜索"
-                  />
-                  <el-button
-                    type="primary"
-                    class="ml-2"
-                    @click="onSearch"
-                    :icon="Search"
-                    >搜索</el-button
-                  >
-                  <Auth value="healthManage:group:edit">
-                    <el-button
-                      type="primary"
-                      :icon="Plus"
-                      class="ml-2"
-                      @click="
-                        state.visibleGroup = true;
-                        state.rowDataOfGroup = {
-                          id: undefined
-                        };
-                      "
-                      >新增管理分组</el-button
-                    >
-                  </Auth>
-                </div>
-              </div>
-            </div>
-          </template>
-          <div>
-            <el-table
-              :data="state.groupList"
-              style="width: 100%"
-              max-height="85vh"
-            >
-              <el-table-column prop="name" label="分组名称" />
-              <el-table-column prop="scope" label="使用人群" />
-              <el-table-column prop="scope" label="对应疾病">
-                <template #default="{ row }">
-                  <div v-if="row.diseases?.length">
-                    <span v-for="(item, index) in row.diseases" :key="item.id">
-                      <el-text>{{ item.properties?.name }}</el-text>
-                      <el-divider
-                        direction="vertical"
-                        v-if="index != row.diseases.length - 1"
-                      />
-                    </span>
-                  </div>
-                  <div v-else>-</div>
-                </template>
-              </el-table-column>
-              <el-table-column prop="scope" label="操作">
-                <template #default="{ row }">
-                  <div>
-                    <Auth value="healthManage:group:edit">
-                      <el-button
-                        type="primary"
-                        link
-                        @click="handleEditGroup(row)"
-                        >编辑</el-button
-                      >
-                      <el-divider direction="vertical" />
-                      <el-popconfirm
-                        title="确定要删除这个分组吗?"
-                        width="300"
-                        @confirm="handleDelete(row.id)"
-                      >
-                        <template #reference>
-                          <el-button type="danger" link>删除</el-button>
-                        </template>
-                      </el-popconfirm>
-                    </Auth>
-                  </div>
-                </template>
-              </el-table-column>
-            </el-table>
-            <el-pagination
-              background
-              class="justify-end mt-4"
-              layout="total, prev, pager, next"
-              :page-size="10"
-              :total="state.total"
-              @change="handleCurrentChange"
-            />
-          </div>
-        </el-card>
-        <el-card shadow="never" class="h-full" v-else>
-          <div>
-            <el-empty />
-          </div>
-        </el-card>
-      </el-col>
-    </el-row>
-    <DialogEditDiseaseGrade
-      v-model:show="state.visible"
-      :rowData="state.rowData"
-      @success="getList"
-    />
-    <DialogEditDiseaseManageGroup
-      v-model:show="state.visibleGroup"
-      :levelId="state.currentValue.id"
-      @success="getGroupList"
-      :rowData="state.rowDataOfGroup"
-    />
-  </div>
-</template>
-<script lang="ts" setup>
-import { reactive } from "vue";
-import { Search, Plus, Edit, Delete } from "@element-plus/icons-vue";
-import DialogEditDiseaseGrade from "./components/DialogEditDiseaseGrade.vue";
-import DialogEditDiseaseManageGroup from "./components/DialogEditDiseaseManageGroup.vue";
-
-import { request } from "@/utils";
-import { ElMessage } from "element-plus";
-
-const state = reactive({
-  visible: false,
-  visibleGroup: false,
-  list: [],
-  groupList: [],
-  total: 0,
-  currentValue: {
-    id: undefined,
-    name: ""
-  },
-  rowData: {},
-  rowDataOfGroup: {}
-});
-
-const query = reactive({
-  name: "",
-  levelId: undefined,
-  page: 1
-});
-
-const initcurrentValue = () => {
-  state.currentValue.id = "";
-  state.currentValue.name = "";
-};
-const getList = () => {
-  request.get("dataService/schemeManage/diseaseManageLevels").then(resp => {
-    state.list = resp.data;
-    if (state.currentValue.id) {
-      state.currentValue = state.list.find(v => v.id == state.currentValue.id);
-    }
-  });
-};
-
-const getGroupList = () => {
-  request
-    .get("dataService/schemeManage/diseaseManageGroup/paginate", {
-      params: { ...query, levelId: state.currentValue.id }
-    })
-    .then(resp => {
-      state.groupList = resp.data.list;
-      state.total = resp.data.total;
-    });
-};
-const onSearch = () => {
-  query.page = 1;
-  getGroupList();
-};
-const handleCurrentChange = page => {
-  query.page = page;
-  getGroupList();
-};
-const handleEdit = () => {
-  state.rowData = state.currentValue;
-  state.visible = true;
-};
-const handleEditGroup = row => {
-  state.rowDataOfGroup = row;
-  state.visibleGroup = true;
-};
-
-const handleDelete = id => {
-  request
-    .post(`dataService/schemeManage/diseaseManageGroup/delete`, {
-      id
-    })
-    .then(resp => {
-      ElMessage.success(resp.message);
-      getGroupList();
-    });
-};
-getList();
-</script>
-<style lang="scss" scoped>
-.active {
-  // color: var(--el-color-primary);
-  background-color: #f5f7fa;
-  border-right: 6px solid var(--el-color-primary);
-}
-::v-deep {
-  .el-table .el-table__body tr:hover > td {
-    background-color: transparent;
-  }
-}
-.left-wrapper:hover {
-  background-color: #f5f7fa;
-}
-</style>

+ 0 - 270
src/views/schemeLibrary/returnVisitTemplate.vue

@@ -1,270 +0,0 @@
-<template>
-  <div>
-    <el-row :gutter="10" style="height: 90vh">
-      <el-col :span="6">
-        <el-card shadow="never" class="h-full">
-          <template #header>
-            <div class="flex items-center justify-between">
-              <div class="flex items-center w-2/3">
-                <el-input
-                  v-model.trim="query.title"
-                  clearable
-                  placeholder="输入标题名称进行搜索"
-                />
-                <el-button
-                  type="primary"
-                  class="ml-2"
-                  @click="onSearch"
-                  :icon="Search"
-                  >搜索</el-button
-                >
-              </div>
-              <el-button
-                type="primary"
-                :icon="Plus"
-                class="ml-2"
-                @click="
-                  state.visible = true;
-                  state.rowData = {
-                    id: undefined
-                  };
-                "
-                >新增</el-button
-              >
-            </div>
-          </template>
-          <div>
-            <el-table
-              :data="state.list"
-              style="width: 100%"
-              :show-header="false"
-              max-height="85vh"
-              @row-click="
-                row => {
-                  state.currentValue = row;
-                }
-              "
-            >
-              <el-table-column prop="name" label="姓名">
-                <template #default="{ row }">
-                  <div
-                    :class="state.currentValue.id == row.id && 'active'"
-                    class="p-2 left-wrapper cursor-pointer"
-                  >
-                    <h3>{{ row.title }}</h3>
-                    <el-text>适用范围:{{ row.scope }}</el-text> <br />
-                    <el-text>最后更新时间:{{ row.updatedAt }}</el-text>
-                  </div>
-                </template>
-              </el-table-column>
-            </el-table>
-
-            <el-pagination
-              background
-              class="justify-end mt-4"
-              layout="total, prev, pager, next"
-              :page-size="10"
-              :total="state.total"
-              @change="handleCurrentChange"
-            />
-          </div>
-        </el-card>
-      </el-col>
-      <el-col :span="18">
-        <el-card shadow="never" v-if="state.currentValue.id" class="h-full">
-          <template #header>
-            <div class="flex items-center justify-between">
-              <div>
-                <h4>{{ state.currentValue.title }}</h4>
-                <el-text>使用范围:{{ state.currentValue.scope }}</el-text>
-              </div>
-              <div class="ml-8">
-                <el-button type="primary" :icon="Edit" link @click="handleEdit"
-                  >编辑</el-button
-                >
-                <el-popconfirm
-                  title="确定要删除这个模板吗?"
-                  width="300"
-                  @confirm="handleDelete"
-                >
-                  <template #reference>
-                    <el-button type="danger" :icon="Delete" link
-                      >删除</el-button
-                    >
-                  </template>
-                </el-popconfirm>
-              </div>
-            </div>
-          </template>
-          <div>
-            <el-radio-group v-model="state.type" size="large">
-              <el-radio-button
-                v-for="(item, index) in typeList"
-                :key="index"
-                :label="item.value"
-              >
-                {{ item.key }}</el-radio-button
-              >
-            </el-radio-group>
-            <el-divider />
-            <template v-if="state.type == 0">
-              <div class="text-center">
-                <el-empty
-                  description="创建随访问卷,可对用户情况进行标准化信息回收,方便后期对比查看管理效果"
-                />
-                <el-button type="primary" @click="handleEditQuestion"
-                  >立即创建</el-button
-                >
-              </div>
-            </template>
-            <template v-else-if="state.type == 1">
-              <div class="text-center">
-                <el-empty
-                  description="设置健康指导内容,方便用户了解在不同时期如何进行自我管理,以及健康注意事项"
-                />
-                <el-button type="primary">立即创建</el-button>
-              </div>
-            </template>
-            <template v-else>
-              <div class="text-center">
-                <el-empty
-                  description="设置随访人员指导内容,指导随访人员如何进行随访"
-                />
-                <el-button type="primary">立即创建</el-button>
-              </div>
-            </template>
-          </div>
-        </el-card>
-        <el-card shadow="never" class="h-full" v-else>
-          <div>
-            <el-empty />
-          </div>
-        </el-card>
-      </el-col>
-    </el-row>
-    <DialogEditSuggestion
-      v-model:show="state.visible"
-      @success="onSearch"
-      :rowData="state.rowData"
-    />
-    <DialogEditQuestion
-      v-model:show="state.visibleQuestion"
-      :surveyId="state.currentValue.id"
-      :submit-questions="saveQuestions"
-      :submit-logic="saveLogicCode"
-    />
-  </div>
-</template>
-<script lang="ts" setup>
-import { reactive, ref } from "vue";
-import { Search, Plus, Edit, Delete } from "@element-plus/icons-vue";
-import DialogEditSuggestion from "./components/DialogEditSuggestion.vue";
-import DialogEditQuestion from "@/components/Survey/DialogEditQuestion.vue";
-
-import { request } from "@/utils";
-import { ElMessage } from "element-plus";
-const typeList = ref([
-  {
-    key: "随访问卷",
-    value: 0
-  },
-  {
-    key: "随访健康指导",
-    value: 1
-  },
-  {
-    key: "随访人员指导",
-    value: 2
-  }
-]);
-const state = reactive({
-  visible: false,
-  list: [],
-  total: 0,
-  type: 0, // 问卷
-  visibleQuestion: false,
-  currentValue: {
-    id: undefined,
-    name: ""
-  },
-  rowData: {}
-});
-const query = reactive({
-  title: "",
-  page: 1
-});
-const initcurrentValue = () => {
-  state.currentValue.id = "";
-  state.currentValue.name = "";
-};
-const onSearch = () => {
-  query.page = 1;
-  getList();
-};
-const getList = () => {
-  request
-    .get("dataService/schemeManage/healthAdvise/paginate", { params: query })
-    .then(resp => {
-      state.list = resp.data.list;
-      state.total = resp.data.total;
-      if (state.currentValue.id) {
-        state.currentValue = state.list.find(
-          v => v.id == state.currentValue.id
-        );
-      }
-    });
-};
-const handleCurrentChange = page => {
-  query.page = page;
-  getList();
-};
-const handleEdit = () => {
-  state.rowData = state.currentValue;
-  state.visible = true;
-};
-const handleDelete = () => {
-  request
-    .post(`dataService/schemeManage/healthAdvise/delete`, {
-      id: state.currentValue.id
-    })
-    .then(resp => {
-      ElMessage.success(resp.message);
-      initcurrentValue();
-      getList();
-    });
-};
-const handleEditQuestion = () => {
-  state.visibleQuestion = true;
-};
-const saveQuestions = async questions => {
-  await request.post(`/surveyService/mechanism/customSurvey/updateContent`, {
-    content: JSON.stringify(questions)
-  });
-  ElMessage.success("保存成功");
-};
-const saveLogicCode = async rules => {
-  await request.post(`/surveyService/mechanism/customSurvey/updateLogicCode`, {
-    logicCode: JSON.stringify(rules)
-  });
-  ElMessage.success("保存成功");
-};
-getList();
-</script>
-<style lang="scss" scoped>
-.active {
-  // color: var(--el-color-primary);
-  background-color: #f5f7fa;
-  border-right: 6px solid var(--el-color-primary);
-}
-::v-deep {
-  .el-card__header {
-    height: 74px;
-  }
-  .el-table .el-table__body tr:hover > td {
-    background-color: transparent;
-  }
-}
-.left-wrapper:hover {
-  background-color: #f5f7fa;
-}
-</style>

+ 0 - 466
src/views/schemeLibrary/reviewTemplate.vue

@@ -1,466 +0,0 @@
-<template>
-  <div class="page-channel p-6">
-    <div class="h-full w-full flex">
-      <div class="mr-2">
-        <el-card shadow="never" class="h-full">
-          <template #header>
-            <div class="flex items-center justify-between">
-              <div class="flex items-center">
-                <el-input
-                  v-model.trim="query.title"
-                  clearable
-                  placeholder="输入标题名称进行搜索"
-                />
-                <el-button
-                  type="primary"
-                  class="ml-2"
-                  @click="onSearch"
-                  :icon="Search"
-                  >搜索</el-button
-                >
-              </div>
-
-              <Auth value="healthManage:visitTemplate:edit">
-                <el-button
-                  type="primary"
-                  :icon="Plus"
-                  class="ml-2"
-                  v-if="!isPageTodoItems"
-                  @click="
-                    editVisible = true;
-                    editForm = {
-                      id: undefined,
-                      title: '',
-                      scope: '',
-                      content: {}
-                    };
-                  "
-                  >新增</el-button
-                >
-              </Auth>
-            </div>
-          </template>
-          <div>
-            <el-table
-              :data="state.list"
-              class="w-full"
-              :show-header="false"
-              max-height="85vh"
-              @row-click="editRow"
-            >
-              <el-table-column prop="name" label="姓名">
-                <template #default="{ row }">
-                  <div
-                    class="p-2 hover:bg-gray-50 cursor-pointer rounded"
-                    :class="{
-                      'bg-gray-10 border-r-4 border-blue-500':
-                        currentValue?.id == row.id
-                    }"
-                  >
-                    <h3>{{ row.title }}</h3>
-                    <el-text>适用范围:{{ row.scope }}</el-text> <br />
-                    <el-text>最后更新时间:{{ row.updatedAt }}</el-text>
-                  </div>
-                </template>
-              </el-table-column>
-            </el-table>
-
-            <el-pagination
-              background
-              class="justify-end mt-4"
-              layout="total, prev, pager, next"
-              :page-size="10"
-              :total="state.total"
-              @change="handleCurrentChange"
-            />
-          </div>
-        </el-card>
-      </div>
-      <div class="flex-1 h-full">
-        <div v-if="currentValue?.id" class="h-full flex flex-col bg-white">
-          <div class="p-4 border-b border-solid border-gray-200">
-            <div class="flex items-center justify-between">
-              <div>
-                <h4>{{ currentValue.title }}</h4>
-                <el-text>使用范围:{{ currentValue.scope }}</el-text>
-              </div>
-              <div class="ml-8">
-                <template v-if="isPageTodoItems">
-                  <el-button
-                    type="primary"
-                    @click="emits('onSelect', currentValue.content)"
-                    >使用该模版</el-button
-                  >
-                </template>
-                <template v-else>
-                  <Auth value="healthManage:visitTemplate:edit">
-                    <el-button
-                      type="primary"
-                      :icon="Edit"
-                      link
-                      @click="handleEdit"
-                      >编辑</el-button
-                    >
-                    <el-popconfirm
-                      title="确定要删除这个模板吗?"
-                      width="300"
-                      @confirm="handleDelete"
-                    >
-                      <template #reference>
-                        <el-button type="danger" :icon="Delete" link
-                          >删除</el-button
-                        >
-                      </template>
-                    </el-popconfirm>
-                  </Auth>
-                </template>
-              </div>
-            </div>
-          </div>
-          <div class="flex-1 p-4 overflow-y-auto">
-            <div class="flex items-center">
-              <div class="flex-1">
-                <div
-                  class="flex items-center w-fit border rounded-3xl border-solid border-gray-400 overflow-hidden"
-                >
-                  <div
-                    v-for="(item, index) in [
-                      '随访问卷',
-                      '随访健康指导',
-                      '随访人员指导'
-                    ]"
-                    :key="index"
-                    @click="curTab = index"
-                    class="relative after:absolute after:right-0 after:top-2.5 after:w-[1px] after:h-4 after:bg-gray-400 after:content-[''] text-xs"
-                  >
-                    <div
-                      class="cursor-pointer text-sm py-2 px-3 first-of-type:pl-6 last-of-type:pr-6 flex items-center"
-                      :class="{
-                        'bg-blue-500 hover:bg-blue-500 text-white':
-                          curTab == index,
-                        'hover:bg-gray-100': curTab != index
-                      }"
-                    >
-                      {{ item }}
-                    </div>
-                  </div>
-                </div>
-              </div>
-              <div>
-                <el-button
-                  v-if="!curTab && currentValue.content?.questions?.length"
-                  type="primary"
-                  @click="editContentVisible.questions = true"
-                  >修改问卷</el-button
-                >
-                <el-button
-                  v-if="curTab == 1 && currentValue.content?.healthGuidance"
-                  type="primary"
-                  @click="editContentVisible.healthGuidance = true"
-                  >修改随访健康指导</el-button
-                >
-                <el-button
-                  v-if="curTab == 2 && currentValue.content?.visitGuidance"
-                  type="primary"
-                  @click="editContentVisible.visitGuidance = true"
-                  >修改随访人员指导</el-button
-                >
-              </div>
-            </div>
-            <div v-if="curTab == 0" class="pt-6">
-              <div v-if="currentValue.content?.questions?.length">
-                <div
-                  v-for="(item, index) in currentValue.content?.questions"
-                  :key="index"
-                  class="m-1 bg-gray-100 rounded p-4 mb-3"
-                >
-                  <SimpleQuestionItem
-                    :info="item"
-                    :id="item.id"
-                    :edit="false"
-                  />
-                </div>
-              </div>
-              <div
-                v-else
-                class="flex flex-col items-center px-4 py-6 mx-[14%] mt-[10%] rounded-lg bg-gray-100 space-y-4"
-              >
-                <div>
-                  创建随访问卷,可对用户情况进行标准化信息回收,方便后期对比查看管理效果
-                </div>
-                <el-button
-                  type="primary"
-                  @click="editContentVisible.questions = true"
-                  >立即创建</el-button
-                >
-              </div>
-            </div>
-            <div v-else-if="curTab == 1" class="py-4 px-2">
-              <div
-                v-if="currentValue.content?.healthGuidance"
-                v-html="currentValue.content?.healthGuidance"
-              />
-              <div
-                v-else
-                class="flex flex-col items-center px-4 py-6 mx-[14%] mt-[10%] rounded-lg bg-gray-100 space-y-4"
-              >
-                <div>
-                  设置健康指导内容,方便用户了解在不同时期如何进行自我管理,以及健康注意事项
-                </div>
-                <el-button
-                  type="primary"
-                  @click="editContentVisible.healthGuidance = true"
-                  >立即创建</el-button
-                >
-              </div>
-            </div>
-            <div v-else-if="curTab == 2" class="py-4 px-2">
-              <div
-                v-if="currentValue.content?.visitGuidance"
-                v-html="currentValue.content?.visitGuidance"
-              />
-              <div
-                v-else
-                class="flex flex-col items-center px-4 py-6 mx-[14%] mt-[10%] rounded-lg bg-gray-100 space-y-4"
-              >
-                <div>设置随访人员指导内容,指导随访人员如何进行随访</div>
-                <el-button
-                  type="primary"
-                  @click="editContentVisible.visitGuidance = true"
-                  >立即创建</el-button
-                >
-              </div>
-            </div>
-          </div>
-        </div>
-        <el-card shadow="never" class="h-full" v-else>
-          <div>
-            <el-empty />
-          </div>
-        </el-card>
-      </div>
-    </div>
-
-    <el-dialog title="回访模板" v-model="editVisible">
-      <div>
-        <el-form ref="formRef" :model="editForm" label-width="120px">
-          <el-form-item
-            label="标题:"
-            prop="title"
-            :rules="[
-              {
-                required: true,
-                message: '请输入模板标题',
-                trigger: 'blur'
-              }
-            ]"
-          >
-            <el-input
-              v-model="editForm.title"
-              placeholder="请输入模板标题"
-              clearable
-            />
-          </el-form-item>
-          <el-form-item
-            label="适用范围:"
-            prop="scope"
-            :rules="[
-              {
-                required: true,
-                message: '请输入适用范围',
-                trigger: 'blur'
-              }
-            ]"
-          >
-            <el-input
-              v-model="editForm.scope"
-              placeholder="请输入适用范围"
-              clearable
-            />
-          </el-form-item>
-        </el-form>
-      </div>
-      <template #footer>
-        <div>
-          <el-button @click="editVisible = false">取 消</el-button>
-          <el-button type="primary" @click="saveEditTemplate">保 存</el-button>
-        </div>
-      </template>
-    </el-dialog>
-
-    <DialogEditQuestion
-      v-model:show="editContentVisible.questions"
-      :initQuestions="currentValue.content?.questions"
-      :initRules="currentValue.content?.logicCode"
-      :submit-questions="saveQuestions"
-      :submit-logic="saveLogicCode"
-    />
-    <el-dialog v-model="editContentVisible.healthGuidance" title="随访健康指导">
-      <Editor v-model:value="currentValue.content.healthGuidance" />
-      <template #footer>
-        <el-button type="primary" @click="saveCurValue('healthGuidance')"
-          >保存</el-button
-        >
-      </template>
-    </el-dialog>
-    <el-dialog v-model="editContentVisible.visitGuidance" title="随访人员指导">
-      <Editor v-model:value="currentValue.content.visitGuidance" />
-      <template #footer>
-        <el-button type="primary" @click="saveCurValue('visitGuidance')"
-          >保存</el-button
-        >
-      </template>
-    </el-dialog>
-  </div>
-</template>
-<script setup>
-import { ref, reactive, computed, defineEmits } from "vue";
-import { Search, Plus, Edit, Delete } from "@element-plus/icons-vue";
-
-import DialogEditQuestion from "@/components/Survey/DialogEditQuestion.vue";
-import Editor from "@/components/Editor.vue";
-import SimpleQuestionItem from "@/components/Survey/SimpleQuestionItem.vue";
-
-import { request } from "@/utils";
-import { ElMessage } from "element-plus";
-import { useRoute } from "vue-router";
-const route = useRoute();
-
-const isPageTodoItems = computed(() =>
-  ["healthManagementTodoList", "archivesProject"].includes(route.name)
-);
-const emits = defineEmits(["onSelect"]);
-const state = reactive({
-  visible: false,
-  list: [],
-  total: 0,
-  rowData: {}
-});
-const query = reactive({
-  title: "",
-  page: 1
-});
-
-const onSearch = () => {
-  query.page = 1;
-  getList();
-};
-const getList = async () => {
-  const { data } = await request.get(
-    "dataService/schemeManage/visit/paginate",
-    { params: query }
-  );
-  state.list = data.list;
-  state.total = data.total;
-  if (query.page == 1 && data.list[0]) {
-    currentValue.value = data.list[0];
-  }
-};
-const handleCurrentChange = page => {
-  query.page = page;
-  getList();
-};
-const handleDelete = async () => {
-  const { message } = await request.post(
-    `dataService/schemeManage/visit/delete`,
-    {
-      id: currentValue.value.id
-    }
-  );
-  ElMessage.success(message);
-  getList();
-};
-getList();
-
-const editRow = row => {
-  row.content = row.content
-    ? row.content
-    : {
-        questions: [],
-        logicCode: [],
-        healthGuidance: "",
-        visitGuidance: ""
-      };
-  currentValue.value = row;
-};
-const editForm = ref({
-  id: "",
-  title: "",
-  scope: "",
-  content: {
-    questions: [],
-    logicCode: [],
-    healthGuidance: "",
-    visitGuidance: ""
-  }
-});
-const editVisible = ref(false);
-const currentValue = ref({
-  id: ""
-});
-const curTab = ref(0);
-const handleEdit = () => {
-  editForm.value = currentValue.value;
-  editVisible.value = true;
-};
-const saveEditTemplate = async () => {
-  const { message } = await request.post(
-    `dataService/schemeManage/visit${editForm.value.id ? "/update" : ""}`,
-    {
-      id: editForm.value.id,
-      title: editForm.value.title,
-      scope: editForm.value.scope,
-      content: editForm.value.content || ""
-    }
-  );
-  ElMessage.success(message);
-  editVisible.value = false;
-  if (!editForm.value.id) {
-    onSearch();
-  }
-  getList();
-};
-
-const editContentVisible = reactive({
-  questions: false,
-  healthGuidance: false,
-  visitGuidance: false
-});
-
-const saveQuestions = async questions => {
-  currentValue.value.content.questions = questions;
-  console.log(questions);
-  // ElMessage.success("保存成功");
-  saveCurValue("questions");
-};
-const saveLogicCode = async rules => {
-  currentValue.value.content.logicCode = rules;
-  // ElMessage.success("保存成功");
-  saveCurValue("logicCode");
-};
-
-const saveCurValue = async prop => {
-  editForm.value = currentValue.value;
-  console.log(currentValue.value);
-  await saveEditTemplate();
-
-  editContentVisible[prop] = false;
-};
-</script>
-<style lang="scss">
-.el-scrollbar__view {
-  height: 100%;
-  .main-content.page-channel {
-    height: 100%;
-    margin: 0;
-  }
-}
-::v-deep {
-  .el-card__header {
-    height: 74px;
-  }
-  .el-table .el-table__body tr:hover > td {
-    background-color: transparent;
-  }
-}
-</style>

Some files were not shown because too many files changed in this diff