解决tinymce打包很大问题
This commit is contained in:
@@ -20,7 +20,7 @@ import MaUser from "./ma-user/index.vue"
|
||||
import MaEditor from "./ma-editor/index.vue"
|
||||
import MaIcon from "./ma-icon/index.vue"
|
||||
import MaUserInfo from "./ma-userInfo/index.vue"
|
||||
import MaCityLinkage from "./ma-cityLinkage/index.vue"
|
||||
import "echarts/dist/echarts.esm.min.mjs"
|
||||
// 后续增加的全局组件
|
||||
import Empty from "./Empty/index.vue"
|
||||
|
||||
@@ -51,7 +51,6 @@ export default {
|
||||
Vue.component("MaEditor", MaEditor)
|
||||
Vue.component("MaIcon", MaIcon)
|
||||
Vue.component("MaUserInfo", MaUserInfo)
|
||||
Vue.component("MaCityLinkage", MaCityLinkage)
|
||||
// 后续增加的组件
|
||||
Vue.component("Empty", Empty)
|
||||
}
|
||||
|
||||
@@ -1,165 +0,0 @@
|
||||
<!--
|
||||
- @Author XXX
|
||||
- @Link XXX
|
||||
-->
|
||||
<template>
|
||||
<a-cascader
|
||||
v-if="props.type === 'cascader'"
|
||||
v-model="val"
|
||||
:field-names="props.mode == 'name' ? { value: 'name', label: 'name' } : { value: 'code', label: 'name' }"
|
||||
:options="jsonData"
|
||||
allow-search
|
||||
check-strictly
|
||||
expand-trigger="hover"
|
||||
path-mode
|
||||
placeholder="请选择省市区"
|
||||
/>
|
||||
<a-space v-else>
|
||||
<a-select
|
||||
v-model="selectData.province"
|
||||
:field-names="props.mode == 'name' ? { value: 'name', label: 'name' } : { value: 'code', label: 'name' }"
|
||||
:options="province"
|
||||
:style="{ width: '220px' }"
|
||||
allow-clear
|
||||
allow-search
|
||||
placeholder="请选择省/直辖市/自治区"
|
||||
@change="provinceChange"
|
||||
@clear="
|
||||
() => {
|
||||
selectData.city = []
|
||||
selectData.area = []
|
||||
selectData.province = []
|
||||
selectData.city = []
|
||||
selectData.area = []
|
||||
province.value = []
|
||||
}
|
||||
"
|
||||
/>
|
||||
<a-select
|
||||
v-model="selectData.city"
|
||||
:field-names="props.mode == 'name' ? { value: 'name', label: 'name' } : { value: 'code', label: 'name' }"
|
||||
:options="city"
|
||||
:style="{ width: '220px' }"
|
||||
allow-clear
|
||||
allow-search
|
||||
placeholder="请选择地级市/市辖区"
|
||||
@change="cityChange"
|
||||
@clear="
|
||||
() => {
|
||||
selectData.city = []
|
||||
selectData.area = []
|
||||
selectData.city = []
|
||||
selectData.area = []
|
||||
}
|
||||
"
|
||||
/>
|
||||
<a-select
|
||||
v-model="selectData.area"
|
||||
:field-names="props.mode == 'name' ? { value: 'name', label: 'name' } : { value: 'code', label: 'name' }"
|
||||
:options="area"
|
||||
:style="{ width: '220px' }"
|
||||
allow-clear
|
||||
allow-search
|
||||
placeholder="请选择区县"
|
||||
@clear="
|
||||
() => {
|
||||
selectData.area = []
|
||||
selectData.area = []
|
||||
}
|
||||
"
|
||||
/>
|
||||
</a-space>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import jsonData from "./lib/city.json"
|
||||
import { ref, watch } from "vue"
|
||||
import { isObject } from "lodash-es"
|
||||
|
||||
const val = ref()
|
||||
const selectData = ref({ province: [], city: [], area: [] })
|
||||
const province = ref([])
|
||||
const city = ref([])
|
||||
const area = ref([])
|
||||
|
||||
const emit = defineEmits(["update:modelValue"])
|
||||
const props = defineProps({
|
||||
modelValue: [Number, String, Object],
|
||||
type: { type: String, default: "select" },
|
||||
mode: { type: String, default: "name" }
|
||||
})
|
||||
|
||||
if (props.type === "select") {
|
||||
province.value = jsonData.map((item) => {
|
||||
return { code: item.code, name: item.name }
|
||||
})
|
||||
}
|
||||
|
||||
const provinceChange = (val, clear = true) => {
|
||||
if (clear) {
|
||||
selectData.value.city = []
|
||||
selectData.value.area = []
|
||||
area.value = []
|
||||
city.value = []
|
||||
}
|
||||
jsonData.map((item) => {
|
||||
if (props.mode == "name" && val == item.name) {
|
||||
city.value = item.children
|
||||
}
|
||||
if (props.mode == "code" && val == item.code) {
|
||||
city.value = item.children
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const cityChange = (val, clear = true) => {
|
||||
if (clear) {
|
||||
selectData.value.area = []
|
||||
area.value = []
|
||||
}
|
||||
city.value.map((item) => {
|
||||
if (props.mode == "name" && val == item.name) {
|
||||
area.value = item.children
|
||||
}
|
||||
if (props.mode == "code" && val == item.code) {
|
||||
area.value = item.children
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const setSelectData = () => {
|
||||
if (props.type === "select") {
|
||||
if (val.value && isObject(val.value)) {
|
||||
selectData.value.province = val.value.province ? val.value.province : ""
|
||||
selectData.value.city = val.value.city ? val.value.city : ""
|
||||
selectData.value.area = val.value.area ? val.value.area : ""
|
||||
selectData.value.province && provinceChange(selectData.value.province, false)
|
||||
selectData.value.city && selectData.value.province && cityChange(selectData.value.city, false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val.value = props.modelValue
|
||||
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(vl) => {
|
||||
val.value = vl
|
||||
setSelectData()
|
||||
},
|
||||
{ deep: true }
|
||||
)
|
||||
|
||||
watch(
|
||||
() => val.value,
|
||||
(vl) => emit("update:modelValue", vl)
|
||||
)
|
||||
|
||||
watch(
|
||||
() => selectData.value,
|
||||
(vl) => emit("update:modelValue", vl),
|
||||
{ deep: true }
|
||||
)
|
||||
|
||||
setSelectData()
|
||||
</script>
|
||||
File diff suppressed because one or more lines are too long
@@ -240,7 +240,7 @@ import { inject, ref, provide } from "vue"
|
||||
import config from "@/config/crud"
|
||||
import uploadConfig from "@/config/upload"
|
||||
import { Message } from "@arco-design/web-vue"
|
||||
import { isFunction, get, isArray, isObject } from "lodash"
|
||||
import { isFunction, get, isArray, isObject } from "lodash-es"
|
||||
import CustomRender from "../js/custom-render"
|
||||
import tool from "@/utils/tool"
|
||||
import commonApi from "@/api/common"
|
||||
|
||||
@@ -9,11 +9,11 @@ import { reactive, ref, watch, computed } from "vue"
|
||||
import { useAppStore } from "@/store"
|
||||
|
||||
import Editor from "@tinymce/tinymce-vue"
|
||||
import tinymce from "tinymce/tinymce"
|
||||
import tinymce from "tinymce/tinymce.min.js"
|
||||
|
||||
import "tinymce/icons/default"
|
||||
import "tinymce/models/dom"
|
||||
import "tinymce/themes/silver"
|
||||
import "tinymce/icons/default/icons.min.js"
|
||||
import "tinymce/models/dom/model.min.js"
|
||||
import "tinymce/themes/silver/theme.min.js"
|
||||
|
||||
// import "tinymce/plugins/advlist" // 高级列表
|
||||
// import "tinymce/plugins/anchor" // 锚点
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
<!--
|
||||
- @Author XXX
|
||||
- @Link XXX
|
||||
-->
|
||||
<template>
|
||||
<ma-form-item
|
||||
v-if="typeof props.component.display == 'undefined' || props.component.display === true"
|
||||
:component="props.component"
|
||||
:custom-field="props.customField"
|
||||
>
|
||||
<slot :name="`form-${props.component.dataIndex}`" v-bind="props.component">
|
||||
<ma-city-linkage v-model="value" :type="props.component.type" :mode="props.component.mode">
|
||||
</ma-city-linkage>
|
||||
</slot>
|
||||
</ma-form-item>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, inject, onMounted, watch } from "vue"
|
||||
import { get, set } from "lodash-es"
|
||||
import MaCityLinkage from "@/components/ma-cityLinkage/index.vue"
|
||||
import MaFormItem from "./form-item.vue"
|
||||
import { runEvent } from "../js/event.js"
|
||||
|
||||
const props = defineProps({
|
||||
component: Object,
|
||||
customField: { type: String, default: undefined }
|
||||
})
|
||||
|
||||
const formModel = inject("formModel")
|
||||
const getColumnService = inject("getColumnService")
|
||||
const columns = inject("columns")
|
||||
const rv = async (ev, value = undefined) =>
|
||||
await runEvent(props.component, ev, { formModel, getColumnService, columns }, value)
|
||||
const index = props.customField ?? props.component.dataIndex
|
||||
const value = ref(get(formModel.value, index))
|
||||
|
||||
watch(
|
||||
() => get(formModel.value, index),
|
||||
(vl) => (value.value = vl)
|
||||
)
|
||||
watch(
|
||||
() => value.value,
|
||||
(v) => {
|
||||
set(formModel.value, index, v)
|
||||
index.indexOf(".") > -1 && delete formModel.value[index]
|
||||
}
|
||||
)
|
||||
|
||||
rv("onCreated")
|
||||
onMounted(() => rv("onMounted"))
|
||||
</script>
|
||||
@@ -73,7 +73,7 @@
|
||||
|
||||
<script setup>
|
||||
import { ref, watch, provide, onMounted, nextTick, getCurrentInstance } from "vue"
|
||||
import { isNil, set, get, cloneDeep } from "lodash"
|
||||
import { isNil, set, get, cloneDeep } from "lodash-es"
|
||||
import defaultOptions from "./js/defaultOptions.js"
|
||||
import {
|
||||
getComponentName,
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
<script setup>
|
||||
import MaInfo from "../ma-info/index.vue";
|
||||
import {getCurrentInstance, reactive, ref, watch} from "vue";
|
||||
import {isArray, isFunction, isObject, isString} from "lodash";
|
||||
import {isArray, isFunction, isObject, isString} from "lodash-es";
|
||||
import {isComponent} from "@arco-design/web-vue/es/_utils/vue-utils";
|
||||
import {setModalSizeEvent} from "@/utils/common";
|
||||
const emit = defineEmits(["visible", "validateError", "open", "cancel", "close"]);
|
||||
@@ -147,4 +147,4 @@ defineExpose({
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<script setup>
|
||||
import { getCurrentInstance, inject, provide, ref, watch } from "vue";
|
||||
import tool from "@/utils/tool";
|
||||
import { get, isArray, isBoolean, isEmpty, isFunction } from "lodash";
|
||||
import { get, isArray, isBoolean, isEmpty, isFunction } from "lodash-es";
|
||||
import { loadDict } from "@cps/ma-form/js/networkRequest.js";
|
||||
import globalColumn from "@/config/column.js";
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<script setup>
|
||||
import { onMounted, ref, watch } from 'vue'
|
||||
import MaResource from '@cps/ma-resource/index.vue'
|
||||
import { isArray } from 'lodash'
|
||||
import { isArray } from 'lodash-es'
|
||||
|
||||
const list = ref()
|
||||
const visible = ref(false)
|
||||
|
||||
@@ -90,7 +90,7 @@ import MaUpload from "@cps/ma-upload/index.vue"
|
||||
import uploadConfig from "@/config/upload"
|
||||
import MaTreeSlider from "@cps/ma-treeSlider/index.vue"
|
||||
import commonApi from "@/api/common"
|
||||
import { xor } from "lodash"
|
||||
import { xor } from "lodash-es"
|
||||
import tool from "@/utils/tool"
|
||||
import { Message } from "@arco-design/web-vue"
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
import { ref, inject, watch } from "vue"
|
||||
import commonApi from "@/api/common"
|
||||
import tool from "@/utils/tool"
|
||||
import { isArray, throttle } from "lodash"
|
||||
import { isArray, throttle } from "lodash-es"
|
||||
import { getFileUrl } from "../js/utils"
|
||||
import { Message } from "@arco-design/web-vue"
|
||||
import file2md5 from "file2md5"
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
import { onMounted, ref, watch } from 'vue'
|
||||
import commonApi from '@/api/common'
|
||||
import { Message } from '@arco-design/web-vue'
|
||||
import { isArray, isEmpty } from 'lodash'
|
||||
import { isArray, isEmpty } from 'lodash-es'
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: { type: Array },
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user