diff --git a/cloud_admin_cas(9,27).zip b/cloud_admin_cas(9,27).zip deleted file mode 100644 index d76f9aa..0000000 Binary files a/cloud_admin_cas(9,27).zip and /dev/null differ diff --git a/src/api/website/solution.js b/src/api/website/solution.js index 2a1d3c3..3f09660 100644 --- a/src/api/website/solution.js +++ b/src/api/website/solution.js @@ -74,6 +74,6 @@ export function serviceCaseEdit(data) { export function serviceCaseDelete(ids) { return request({ url: `/business/solutionCase/${ids}`, - method: "post", + method: "delete", }); } diff --git a/src/components/WangEditor/index.vue b/src/components/WangEditor/index.vue index d8cce06..44c0acd 100644 --- a/src/components/WangEditor/index.vue +++ b/src/components/WangEditor/index.vue @@ -28,7 +28,8 @@ import { watch, } from "vue"; import { Editor, Toolbar } from "@wangeditor/editor-for-vue"; - +import request from "@/utils/request"; +import { getToken } from "@/utils/auth"; export default { components: { Editor, Toolbar }, props: { @@ -76,26 +77,45 @@ export default { ); const { height } = toRefs(props); const toolbarConfig = { - toolbarKeys: [ - "bold", - "underline", - "italic", - "through", - "color", - "bgColor", - "fontSize", - "fontFamily", - "lineHeight", - // "emotion", - // "redo", - // "undo", - ], + // toolbarKeys: [ + // "bold", + // "underline", + // "italic", + // "through", + // "color", + // "bgColor", + // "fontSize", + // "fontFamily", + // "lineHeight", + // "uploadImage", + // // "emotion", + // // "redo", + // // "undo", + // ], }; const editorConfig = { placeholder: "请输入内容...", autoFocus: props.focus, maxLength: 140, readOnly: props.readOnly, + MENU_CONF: { + uploadImage: { + async customUpload(file, insertFn) { + const fd = new FormData(); + fd.append("file", file); + const resp = await request({ + url: "/common/upload", + method: "post", + data: fd, + headers: { + Authorization: "Bearer " + getToken(), + }, + }); + + insertFn(resp.url, "", resp.url); + }, + }, + }, }; onMounted(() => { // console.log(editorRef.value.getConfig()); @@ -110,6 +130,7 @@ export default { const handleCreated = (editor) => { editorRef.value = editor; // 记录 editor 实例,重要! + console.log(editorRef.value.getAllMenuKeys()); }; const handleChange = (editor) => { diff --git a/src/utils/parameter.js b/src/utils/parameter.js index ad331b0..11eaf12 100644 --- a/src/utils/parameter.js +++ b/src/utils/parameter.js @@ -35,19 +35,19 @@ export const enterpriseOptions = [ ]; // 成果成熟度 技术 export const maturityOptions = [ - { key: 1, value: "正在研发" }, - { key: 2, value: "小试阶段" }, - { key: 3, value: "通过小试" }, - { key: 4, value: "中试阶段" }, - { key: 5, value: "通过中试" }, - { key: 6, value: "可规模生产" }, + { key: "1", value: "正在研发" }, + { key: "2", value: "小试阶段" }, + { key: "3", value: "通过小试" }, + { key: "4", value: "中试阶段" }, + { key: "5", value: "通过中试" }, + { key: "6", value: "可规模生产" }, ]; // 成果领先型 领先标准 export const leadOptions = [ - { key: 1, value: "国内先进" }, - { key: 2, value: "国内领先" }, - { key: 3, value: "国际先进" }, - { key: 4, value: "国际领先" }, + { key: "1", value: "国内先进" }, + { key: "2", value: "国内领先" }, + { key: "3", value: "国际先进" }, + { key: "4", value: "国际领先" }, ]; // 专利类型 export const patentOptions = [ @@ -57,13 +57,13 @@ export const patentOptions = [ ]; // 合作模式 export const cooperationOptions = [ - { key: 101, value: "技术转让" }, - { key: 102, value: "技术许可" }, - { key: 103, value: "技术入股" }, - { key: 104, value: "合作开发" }, - { key: 105, value: "融资" }, - { key: 106, value: "公司" }, - { key: 107, value: "代理加盟" }, - { key: 108, value: "市场推广" }, - { key: 109, value: "其他" }, + { key: "101", value: "技术转让" }, + { key: "102", value: "技术许可" }, + { key: "103", value: "技术入股" }, + { key: "104", value: "合作开发" }, + { key: "105", value: "融资" }, + { key: "106", value: "公司" }, + { key: "107", value: "代理加盟" }, + { key: "108", value: "市场推广" }, + { key: "109", value: "其他" }, ]; diff --git a/src/utils/request.js b/src/utils/request.js index 79c720c..dab3d7d 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -154,5 +154,30 @@ export function download(url, params, filename) { downloadLoadingInstance.close(); }) } +export function customDownload(url, params, filename) { + downloadLoadingInstance = ElLoading.service({ text: "正在下载数据,请稍候", background: "rgba(0, 0, 0, 0.7)", }) + return service.get(url, params, { + baseURL:"", + transformRequest: [(params) => { return tansParams(params) }], + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + responseType: 'blob' + }).then(async (data) => { + const isLogin = await blobValidate(data); + if (isLogin) { + const blob = new Blob([data]) + saveAs(blob, filename) + } else { + const resText = await data.text(); + const rspObj = JSON.parse(resText); + const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default'] + ElMessage.error(errMsg); + } + downloadLoadingInstance.close(); + }).catch((r) => { + console.error(r) + ElMessage.error('下载文件出现错误,请联系管理员!') + downloadLoadingInstance.close(); + }) +} export default service diff --git a/src/views/Enterpriseproducts/approval.vue b/src/views/Enterpriseproducts/approval.vue index 00a323a..e713922 100644 --- a/src/views/Enterpriseproducts/approval.vue +++ b/src/views/Enterpriseproducts/approval.vue @@ -11,9 +11,9 @@ - + @@ -51,7 +51,7 @@ v-model="form" title="应用客户" placeholder="请输入应用客户" - fieldKey="customer" + fieldKey="customers" ref="customerForm" :disabled="true" /> @@ -77,9 +77,9 @@ - + @@ -98,7 +98,7 @@ @@ -149,7 +149,13 @@ - + + 下载产品图片 -

+ - + /> --> + 下载成熟度证明材料 @@ -201,6 +213,7 @@ import { } from "@/utils/parameter"; import { useRoute, useRouter } from "vue-router"; import { ElMessage } from "element-plus"; +import { customDownload } from "@/utils/request"; // import WangEditor from "@/components/WangEditor/index.vue"; // const isAdd = ref(false); const route = useRoute(); @@ -231,6 +244,18 @@ const getDetail = async (id) => { if (route.query.id) { getDetail(route.query.id); } +const downloadProductImage = () => { + const filename = + form.value.image.split("/")[form.value.image.split("/").length - 1]; + customDownload(form.value.image, {}, filename); +}; +const downloadProductMaterial = () => { + const filename = + form.value.material.split("/")[form.value.material.split("/").length - 1]; + const baseUrl = import.meta.env.VITE_APP_BASE_API; + customDownload(`/file${form.value.material}`, {}, filename); +}; + const submitForm = async (status) => { await updateEnterpriseApprovalProduct({ ...form.value, status }); let successMessage; diff --git a/src/views/Enterpriseproducts/index.vue b/src/views/Enterpriseproducts/index.vue index a1285af..793ce46 100644 --- a/src/views/Enterpriseproducts/index.vue +++ b/src/views/Enterpriseproducts/index.vue @@ -51,7 +51,7 @@