diff --git a/klp-ui/src/api/wms/productSalesScript.js b/klp-ui/src/api/wms/productSalesScript.js
index 738b156d..750e7f90 100644
--- a/klp-ui/src/api/wms/productSalesScript.js
+++ b/klp-ui/src/api/wms/productSalesScript.js
@@ -9,6 +9,15 @@ export function listProductSalesScript(query) {
})
}
+// 查询产品销售话术,只要标题和内容有一个配置就会被返回
+export function searchProductSalesScript(keyword) {
+ return request({
+ url: '/klp/productSalesScript/list',
+ method: 'get',
+ params: { keyword }
+ })
+}
+
// 查询产品销售话术详细
export function getProductSalesScript(scriptId) {
return request({
diff --git a/klp-ui/src/components/MarkdownPreview.vue b/klp-ui/src/components/MarkdownPreview.vue
new file mode 100644
index 00000000..ba32b8cd
--- /dev/null
+++ b/klp-ui/src/components/MarkdownPreview.vue
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
diff --git a/klp-ui/src/components/VditorEditor.vue b/klp-ui/src/components/VditorEditor.vue
index 3a6cc980..54e7c2a8 100644
--- a/klp-ui/src/components/VditorEditor.vue
+++ b/klp-ui/src/components/VditorEditor.vue
@@ -12,6 +12,10 @@ export default {
value: {
type: String,
default: ''
+ },
+ readonly: {
+ type: Boolean,
+ default: false
}
},
data() {
@@ -20,27 +24,40 @@ export default {
}
},
mounted() {
- this.vditor = new Vditor('vditor', {
+ const config = {
value: this.value,
height: 360,
- toolbarConfig: {
- pin: true,
- },
- cache: {
- enable: false,
- },
+ cache: { enable: false },
after: () => {
this.vditor.setValue(this.value || '')
},
input: (val) => {
this.$emit('input', val)
}
- })
+ };
+ if (this.readonly) {
+ config.toolbar = []; // 不显示工具栏
+ config.editable = false;
+ } else {
+ config.toolbarConfig = { pin: true };
+ config.editable = true;
+ }
+ this.vditor = new Vditor('vditor', config);
+ if (this.readonly) {
+ console.log(this.vditor)
+ this.vditor.vditor.disabled()
+ }
},
watch: {
value(val) {
if (this.vditor && val !== this.vditor.getValue()) {
this.vditor.setValue(val || '')
+ // 只读模式下内容变化时重新渲染mermaid
+ if (this.readonly && window.VditorPreview && typeof window.VditorPreview.mermaidRender === 'function') {
+ this.$nextTick(() => {
+ window.VditorPreview.mermaidRender(document);
+ });
+ }
}
}
}
diff --git a/klp-ui/src/views/wms/productSalesScript/detail.vue b/klp-ui/src/views/wms/productSalesScript/detail.vue
new file mode 100644
index 00000000..5a91e200
--- /dev/null
+++ b/klp-ui/src/views/wms/productSalesScript/detail.vue
@@ -0,0 +1,116 @@
+
+