提交 0441efbf authored 作者: 王鹏飞's avatar 王鹏飞

refactor: 移除 reactivity-transform 宏,迁移到原生 ref/computed,升级依赖

上级 61d1cd2f
...@@ -267,6 +267,7 @@ ...@@ -267,6 +267,7 @@
"useThrottleFn": true, "useThrottleFn": true,
"useThrottledRefHistory": true, "useThrottledRefHistory": true,
"useTimeAgo": true, "useTimeAgo": true,
"useTimeAgoIntl": true,
"useTimeout": true, "useTimeout": true,
"useTimeoutFn": true, "useTimeoutFn": true,
"useTimeoutPoll": true, "useTimeoutPoll": true,
......
/* eslint-disable */ /* eslint-disable */
/* prettier-ignore */ /* prettier-ignore */
/* oxlint-disable */
/* oxfmt-ignore */
// @ts-nocheck // @ts-nocheck
// noinspection JSUnusedGlobalSymbols // noinspection JSUnusedGlobalSymbols
// Generated by unplugin-auto-import // Generated by unplugin-auto-import
...@@ -263,6 +265,7 @@ declare global { ...@@ -263,6 +265,7 @@ declare global {
const useThrottleFn: typeof import('@vueuse/core').useThrottleFn const useThrottleFn: typeof import('@vueuse/core').useThrottleFn
const useThrottledRefHistory: typeof import('@vueuse/core').useThrottledRefHistory const useThrottledRefHistory: typeof import('@vueuse/core').useThrottledRefHistory
const useTimeAgo: typeof import('@vueuse/core').useTimeAgo const useTimeAgo: typeof import('@vueuse/core').useTimeAgo
const useTimeAgoIntl: typeof import('@vueuse/core').useTimeAgoIntl
const useTimeout: typeof import('@vueuse/core').useTimeout const useTimeout: typeof import('@vueuse/core').useTimeout
const useTimeoutFn: typeof import('@vueuse/core').useTimeoutFn const useTimeoutFn: typeof import('@vueuse/core').useTimeoutFn
const useTimeoutPoll: typeof import('@vueuse/core').useTimeoutPoll const useTimeoutPoll: typeof import('@vueuse/core').useTimeoutPoll
......
import fs from 'node:fs'
import path from 'node:path'
import axios from 'axios'
const __dirname = path.resolve()
const domain = 'ezijing.com'
const outputPath = './https'
// 生成文件夹
function genOutputDir() {
if (fs.existsSync(outputPath)) {
console.log('The path exists.')
} else {
fs.mkdir(outputPath, { recursive: true }, err => {
if (err) throw err
})
}
}
function downloadCertFile() {
genOutputDir()
axios.get(`https://ssl.godzyx.com/${domain}/${domain}.key?get=allow`, { responseType: 'stream' }).then(response => {
response.data.pipe(fs.createWriteStream(path.join(__dirname, `${outputPath}/${domain}.key`)))
})
axios.get(`https://ssl.godzyx.com/${domain}/${domain}.pem?get=allow`, { responseType: 'stream' }).then(response => {
response.data.pipe(fs.createWriteStream(path.join(__dirname, `${outputPath}/${domain}.pem`)))
})
}
downloadCertFile()
...@@ -10,7 +10,7 @@ export default [ ...@@ -10,7 +10,7 @@ export default [
{ {
name: 'app/files-to-ignore', name: 'app/files-to-ignore',
ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**'], ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**', 'public/lib/**', 'public/screenshot.js'],
}, },
...pluginVue.configs['flat/essential'], ...pluginVue.configs['flat/essential'],
......
-----BEGIN RSA PRIVATE KEY-----
MIIEpQIBAAKCAQEAwZGHX8Zg+EP5uwnEBWkQazq8DMnKz3QfcNRUjFsxsZjM/98r
oYYp+K6/i/b8JXAVMqjC9+X/ZajgbDPLTrgDJ4TQ70ajdusqG3swNqG0qLUogNgU
PcgVRKr2Pk+m79GD/nnxFgeaG6eBfLsb73G2cQUwsgi3bjf6mX6b9bjxjqzwX0PW
es27yyqdS9uQFzV5KLTA2FJJjGGbg54ZLxVc01aVXx2gG0eLnOFcDSmgXUN4hBmN
gYF4FYHhOVXdMl2+yGGp6IvtIIrt+cp2/TQePnxB2QYwrlDMajHrKp0x7LsqWwZT
jepPgGWWDssiSgTCYVaPx28ESbotpzR7D+LlHQIDAQABAoIBAQCCvXGrHcmXRgph
62mrodgGJQioto82aZ9mzPNCTcIVyzgDRtAoa/7jSdx0g+CwxLB8pAH0ADPtjQ/v
5VfXlnAC/DFGu/Zittmc8CqTa8si/CEcTVX2mLLMy5BAa/o8Fs5JTkGo+H99WDkc
byCiLLLmSXQne72xQzwO+rYKVN1K2JUfzch5wpv86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I1qsb2pY7
HVkCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEA
uI3O7+cUus/usESSbLQ5PqKEbq24IXfS1HeCh+YgQYHu4vgRt2PRFze+GXYkHAQa
TOs9qmdvLdTN/mUxcMUbpgIKumB7bVjCmkn+YzILa+M6wKyrO7Do0wlRjBCDxjTg
xSvgGrZgFCdsMneMvLJymM/NzD+5yCRCFNZX/OYmQ6kd5YCQzgNUKD73P9P4Te1q
CjqTE5s7FCMTY5w/0YcneeVMUeMBrYVdGjux1XMQpNPyvG5k9VpWkKjHDkx0Dy5x
O/fIR/RpbxXyEV6DHpx8Uq79AtoSqFlnGNu8cN2bsWntgM6JQEhqDjXKKWYVIZQs
6GAqm4VKQPNriiTsBhYscw==
-----END CERTIFICATE-----
<!DOCTYPE html> <!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="icon" href="https://zws-imgs-pub.ezijing.com/pc/base/favicon.ico" /> <link rel="icon" href="/favicon.ico" />
<meta <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
/>
<title>数字营销实验室DML</title> <title>数字营销实验室DML</title>
<script src="https://webapp-pub.ezijing.com/screenshot.js" async></script>
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>
<script type="module" src="/src/main.ts"></script> <script type="module" src="/src/main.ts"></script>
<script src="/lib/tinymce@6/tinymce.min.js"></script>
<script src="https://webapp-pub.ezijing.com/screenshot.js" async></script>
<script src="https://webapp-pub.ezijing.com/plugins/sky-agents/sky-agent.umd.cjs?v=2"></script> <script src="https://webapp-pub.ezijing.com/plugins/sky-agents/sky-agent.umd.cjs?v=2"></script>
<script src="https://webapp-pub.ezijing.com/plugins/tinymce@6/tinymce.min.js"></script>
</body> </body>
</html> </html>
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -5,73 +5,69 @@ ...@@ -5,73 +5,69 @@
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite --mode dev", "dev": "vite --mode dev",
"build": "vue-tsc --noEmit && vite build --mode prod && npm run deploy", "build": "npm run typecheck && vite build --mode prod && npm run deploy",
"build:school": "vue-tsc --noEmit && vite build --mode school", "build:prod": "npm run typecheck && vite build --mode prod",
"build:test": "vue-tsc --noEmit && vite build --mode test", "build:school": "npm run typecheck && vite build --mode school",
"build:pre": "vue-tsc --noEmit && vite build --mode pre",
"preview": "vite preview --port 4173", "preview": "vite preview --port 4173",
"typecheck": "vue-tsc --noEmit", "typecheck": "vue-tsc -b --noEmit",
"lint": "eslint . --fix", "lint": "eslint . --fix",
"deploy": "node ./deploy.js", "deploy": "node ./deploy.js"
"cert": "node ./cert.js"
}, },
"dependencies": { "dependencies": {
"@chuangkit/chuangkit-design": "^2.0.5", "@chuangkit/chuangkit-design": "^2.3.0",
"@dagrejs/dagre": "^1.1.3", "@dagrejs/dagre": "^1.1.3",
"@element-plus/icons-vue": "^2.3.1", "@element-plus/icons-vue": "^2.3.1",
"@ezijing/ai-core": "^1.0.0", "@ezijing/ai-core": "^1.0.0",
"@ezijing/ai-vue": "^1.0.44", "@ezijing/ai-vue": "^1.0.44",
"@fortaine/fetch-event-source": "^3.0.6", "@fortaine/fetch-event-source": "^3.0.6",
"@remixicon/vue": "^4.7.0", "@remixicon/vue": "^4.9.0",
"@tinymce/tinymce-vue": "^5.0.1", "@tinymce/tinymce-vue": "^5.1.1",
"@vue-flow/controls": "^1.1.2", "@vue-flow/controls": "^1.1.3",
"@vue-flow/core": "^1.39.0", "@vue-flow/core": "^1.39.0",
"@vueuse/components": "^13.3.0", "@vueuse/components": "^13.9.0",
"@vueuse/core": "^13.3.0", "@vueuse/core": "^13.9.0",
"ali-oss": "^6.23.0", "ali-oss": "^6.23.0",
"axios": "^1.9.0", "axios": "^1.20.0",
"blueimp-md5": "^2.19.0", "blueimp-md5": "^2.19.0",
"crypto-js": "^4.2.0", "crypto-js": "^4.2.0",
"dayjs": "^1.11.10", "dayjs": "^1.11.10",
"echarts": "^5.5.0", "echarts": "^5.6.0",
"echarts-wordcloud": "^2.1.0", "echarts-wordcloud": "^2.1.0",
"element-plus": "^2.11.9", "element-plus": "^2.14.7",
"eventsource-parser": "^3.0.2", "eventsource-parser": "^3.1.1",
"file-saver": "^2.0.5", "file-saver": "^2.0.5",
"file-type": "^21.1.0", "file-type": "^21.3.4",
"html-to-image": "^1.11.11", "html-to-image": "^1.11.13",
"jspdf": "^2.5.1", "jspdf": "^2.5.1",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"nanoid": "^5.0.7", "nanoid": "^5.1.16",
"pinia": "^2.2.6", "pinia": "^2.2.6",
"scroll-into-view-if-needed": "^3.1.0", "scroll-into-view-if-needed": "^3.1.0",
"uuid": "^11.1.0", "uuid": "^11.1.1",
"vue": "^3.5.25", "vue": "^3.5.44",
"vue-echarts": "^6.6.9", "vue-echarts": "^6.7.3",
"vue-markdown-render": "^2.2.1", "vue-markdown-render": "^2.3.1",
"vue-router": "^4.5.1", "vue-router": "^4.6.4",
"xss": "^1.0.15" "xss": "^1.0.15"
}, },
"devDependencies": { "devDependencies": {
"@tsconfig/node20": "^20.1.4", "@tsconfig/node20": "^20.1.10",
"@types/ali-oss": "^6.16.13", "@types/ali-oss": "^6.23.3",
"@types/blueimp-md5": "^2.18.2", "@types/blueimp-md5": "^2.18.2",
"@types/crypto-js": "^4.2.2", "@types/crypto-js": "^4.2.2",
"@types/file-saver": "^2.0.7", "@types/file-saver": "^2.0.7",
"@types/node": "^20.17.6", "@types/node": "^20.19.43",
"@vitejs/plugin-vue": "^6.0.1", "@vitejs/plugin-vue": "^6.0.10",
"@vue-macros/reactivity-transform": "^1.1.6", "@vue/eslint-config-typescript": "^14.9.0",
"@vue/eslint-config-typescript": "^14.1.3", "@vue/tsconfig": "^0.9.1",
"@vue/tsconfig": "^0.5.1",
"chalk": "^5.3.0", "chalk": "^5.3.0",
"eslint": "^9.14.0", "eslint": "^10.12.0",
"eslint-plugin-vue": "^9.30.0", "eslint-plugin-vue": "^10.11.1",
"sass-embedded": "^1.93.3", "sass-embedded": "^1.105.1",
"typescript": "~5.6.3", "typescript": "~6.0.3",
"unplugin-auto-import": "^20.2.0", "unplugin-auto-import": "^21.1.0",
"vite": "^7.3.6", "vite": "^8.3.4",
"vite-plugin-checker": "^0.11.0", "vite-plugin-mkcert": "^2.1.0",
"vite-plugin-mkcert": "^1.17.9", "vue-tsc": "^3.3.13"
"vue-tsc": "^2.1.10"
} }
} }
...@@ -3,7 +3,7 @@ interface Props { ...@@ -3,7 +3,7 @@ interface Props {
src?: string src?: string
} }
const props = defineProps<Props>() const props = defineProps<Props>()
const currentUrl = $computed(() => { const currentUrl = computed(() => {
return props.src || `${import.meta.env.BASE_URL}avatar.svg` return props.src || `${import.meta.env.BASE_URL}avatar.svg`
}) })
</script> </script>
......
...@@ -6,12 +6,12 @@ interface Props { ...@@ -6,12 +6,12 @@ interface Props {
} }
const props = defineProps<Props>() const props = defineProps<Props>()
// 文件扩展名 // 文件扩展名
const fileExtensionName = $computed(() => { const fileExtensionName = computed(() => {
return new URL(props.url, location.href).pathname.split('.').pop()?.toLowerCase() || '' return new URL(props.url, location.href).pathname.split('.').pop()?.toLowerCase() || ''
}) })
// office文件 // office文件
const officeUrl = $computed(() => { const officeUrl = computed(() => {
return ['ppt', 'pptx', 'doc', 'docx', 'xls', 'xlsx'].includes(fileExtensionName) return ['ppt', 'pptx', 'doc', 'docx', 'xls', 'xlsx'].includes(fileExtensionName.value)
? getOnlinePreviewUrl(props.url) ? getOnlinePreviewUrl(props.url)
: '' : ''
}) })
......
...@@ -10,14 +10,14 @@ interface SearchUser { ...@@ -10,14 +10,14 @@ interface SearchUser {
email: string email: string
} }
let loading = $ref(false) const loading = ref(false)
let userList = $ref<SearchUser[]>() const userList = ref<SearchUser[]>()
const remoteMethod = (q: string) => { const remoteMethod = (q: string) => {
if (!q) return if (!q) return
loading = true loading.value = true
searchUser({ q: q }).then(res => { searchUser({ q: q }).then(res => {
loading = false loading.value = false
userList = res.data.items userList.value = res.data.items
}) })
} }
</script> </script>
......
...@@ -18,7 +18,7 @@ const emit = defineEmits<{ ...@@ -18,7 +18,7 @@ const emit = defineEmits<{
(e: 'update:modelValue', visible: boolean): void (e: 'update:modelValue', visible: boolean): void
}>() }>()
const form = $ref( const form = ref(
props.data || { props.data || {
name: '', name: '',
content: '', content: '',
...@@ -34,12 +34,12 @@ const rules = ref<FormRules>({ ...@@ -34,12 +34,12 @@ const rules = ref<FormRules>({
// 提交 // 提交
const submitForm = (formEl: FormInstance | undefined) => { const submitForm = (formEl: FormInstance | undefined) => {
const params = Object.assign(form, { type: props.type }) const params = Object.assign(form.value, { type: props.type })
if (!formEl) return if (!formEl) return
formEl.validate(valid => { formEl.validate(valid => {
if (valid) { if (valid) {
if (props.data?.id) { if (props.data?.id) {
updateMaterial(form).then(() => { updateMaterial(form.value).then(() => {
emit('update') emit('update')
emit('update:modelValue', false) emit('update:modelValue', false)
ElMessage({ message: '更新成功', type: 'success' }) ElMessage({ message: '更新成功', type: 'success' })
...@@ -59,7 +59,7 @@ const submitForm = (formEl: FormInstance | undefined) => { ...@@ -59,7 +59,7 @@ const submitForm = (formEl: FormInstance | undefined) => {
// 查看h5链接 // 查看h5链接
const handleViewH5 = function () { const handleViewH5 = function () {
window.open(`https://${form.content}`) window.open(`https://${form.value.content}`)
} }
const typeName = computed(() => { const typeName = computed(() => {
......
...@@ -14,7 +14,7 @@ const props = defineProps<Props>() ...@@ -14,7 +14,7 @@ const props = defineProps<Props>()
const role = inject('role') as string const role = inject('role') as string
const score = inject('score') as number const score = inject('score') as number
const { nodes } = useVueFlow() const { nodes, updateNodeData } = useVueFlow()
const formRef = ref<FormInstance>() const formRef = ref<FormInstance>()
const form = reactive({ const form = reactive({
...@@ -51,7 +51,7 @@ async function submit() { ...@@ -51,7 +51,7 @@ async function submit() {
function updateNode() { function updateNode() {
// const params = props.paramsParse ? props.paramsParse(form) : {} // const params = props.paramsParse ? props.paramsParse(form) : {}
if (props.node && role) Object.assign(props.node.data, { [role]: { ...form } }) if (props.node && role) updateNodeData(props.node.id, { [role]: { ...form } })
} }
</script> </script>
......
...@@ -2,11 +2,13 @@ ...@@ -2,11 +2,13 @@
<script setup lang="ts"> <script setup lang="ts">
import type { FormInstance, FormRules } from 'element-plus' import type { FormInstance, FormRules } from 'element-plus'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import { useVueFlow } from '@vue-flow/core'
interface Props { interface Props {
node: any node: any
} }
const props = defineProps<Props>() const props = defineProps<Props>()
const { updateNodeData } = useVueFlow()
const emit = defineEmits(['update:modelValue']) const emit = defineEmits(['update:modelValue'])
...@@ -33,7 +35,7 @@ function submit() { ...@@ -33,7 +35,7 @@ function submit() {
} }
function updateNode() { function updateNode() {
if (props.node && role) Object.assign(props.node.data, { student: { ...form } }) if (props.node && role) updateNodeData(props.node.id, { student: { ...form } })
} }
</script> </script>
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
import type { FormInstance } from 'element-plus' import type { FormInstance } from 'element-plus'
import { SuccessFilled, CircleCloseFilled } from '@element-plus/icons-vue' import { SuccessFilled, CircleCloseFilled } from '@element-plus/icons-vue'
import { useQueryUser } from '../composables/useQueryUser' import { useQueryUser } from '../composables/useQueryUser'
import { useVueFlow } from '@vue-flow/core'
interface Props { interface Props {
title?: string title?: string
...@@ -15,6 +16,7 @@ interface Props { ...@@ -15,6 +16,7 @@ interface Props {
} }
const props = withDefaults(defineProps<Props>(), { title: '配置数据生成规则', step: false }) const props = withDefaults(defineProps<Props>(), { title: '配置数据生成规则', step: false })
const { updateNodeData } = useVueFlow()
const formRef = ref<FormInstance>() const formRef = ref<FormInstance>()
const form = reactive({ const form = reactive({
...@@ -87,7 +89,7 @@ function updateNode() { ...@@ -87,7 +89,7 @@ function updateNode() {
if (!props.node) return if (!props.node) return
const params = props.paramsParse ? props.paramsParse(props.node.data.teacher, form) : {} const params = props.paramsParse ? props.paramsParse(props.node.data.teacher, form) : {}
const generate = props.generateParse ? props.generateParse(props.node.data.teacher, form) : {} const generate = props.generateParse ? props.generateParse(props.node.data.teacher, form) : {}
Object.assign(props.node.data, { updateNodeData(props.node.id, {
rule: { rule: {
...form, ...form,
correct_operation_user_total: correctUserTotalText.value, correct_operation_user_total: correctUserTotalText.value,
......
...@@ -90,7 +90,7 @@ function handleOperateChange(value: string, item: any) { ...@@ -90,7 +90,7 @@ function handleOperateChange(value: string, item: any) {
<el-input v-model="rule.value" placeholder="请输入属性值" :maxlength="getAttr(rule.attr_id)?.format" style="width: 180px"></el-input> <el-input v-model="rule.value" placeholder="请输入属性值" :maxlength="getAttr(rule.attr_id)?.format" style="width: 180px"></el-input>
</template> </template>
</el-form-item> </el-form-item>
<el-icon style="margin-left: 10px" size="20" color="#cf5b78" @click="removeRule(index)" v-if="index !== 0"> <el-icon style="margin-left: 10px" size="20" color="#cf5b78" @click="removeRule(Number(index))" v-if="index !== 0">
<RemoveFilled /> <RemoveFilled />
</el-icon> </el-icon>
<el-icon style="margin-left: 10px" size="20" color="#cf5b78" @click="addRule" v-if="index === form.rules.length - 1"> <el-icon style="margin-left: 10px" size="20" color="#cf5b78" @click="addRule" v-if="index === form.rules.length - 1">
......
<script setup lang="ts"> <script setup lang="ts">
import RuleTemplate from '../../RuleTemplate.vue' import RuleTemplate from '../../RuleTemplate.vue'
import { useVueFlow } from '@vue-flow/core'
const props = defineProps<{ node: any }>() const props = defineProps<{ node: any }>()
const { updateNodeData } = useVueFlow()
function onSubmit(form: any) { function onSubmit(form: any) {
form.expected_user_total = form.user_total form.expected_user_total = form.user_total
Object.assign(props.node.data, { rule: form, rule_params: {} }) updateNodeData(props.node.id, { rule: form, rule_params: {} })
} }
</script> </script>
......
...@@ -14,7 +14,7 @@ import { searchEventAttrs } from '@/api/base' ...@@ -14,7 +14,7 @@ import { searchEventAttrs } from '@/api/base'
const { limit = Infinity } = defineProps<{ limit?: number }>() const { limit = Infinity } = defineProps<{ limit?: number }>()
// const eventAttrRule = ref(inject('eventAttrRule') as EventRule) // const eventAttrRule = ref(inject('eventAttrRule') as EventRule)
const eventAttrRule = defineModel<EventRule>({ default: { current_logic_operate: 'and', items: [] } }) const eventAttrRule = defineModel<EventRule>({ default: () => ({ current_logic_operate: 'and', items: [] }) })
const { metaEventList } = useMetaEvent() const { metaEventList } = useMetaEvent()
......
...@@ -3,7 +3,7 @@ import type { GroupRule } from '@/types' ...@@ -3,7 +3,7 @@ import type { GroupRule } from '@/types'
import { PriceTag, Plus, CloseBold } from '@element-plus/icons-vue' import { PriceTag, Plus, CloseBold } from '@element-plus/icons-vue'
import { useGroup } from '@/composables/useAllData' import { useGroup } from '@/composables/useAllData'
const rule = defineModel<GroupRule>({ default: { current_logic_operate: 'and', items: [] } }) const rule = defineModel<GroupRule>({ default: () => ({ current_logic_operate: 'and', items: [] }) })
const { buttonText = '添加条件' } = defineProps<{ const { buttonText = '添加条件' } = defineProps<{
buttonText?: string buttonText?: string
......
...@@ -5,7 +5,7 @@ import { useTag } from '@/composables/useAllData' ...@@ -5,7 +5,7 @@ import { useTag } from '@/composables/useAllData'
import { useRfmRes } from '@/composables/useRFMData' import { useRfmRes } from '@/composables/useRFMData'
// const tagRule = ref(inject('tagRule') as TagRule) // const tagRule = ref(inject('tagRule') as TagRule)
const tagRule = defineModel<TagRule>({ default: { current_logic_operate: 'and', items: [] } }) const tagRule = defineModel<TagRule>({ default: () => ({ current_logic_operate: 'and', items: [] }) })
const { buttonText = '添加条件' } = defineProps<{ const { buttonText = '添加条件' } = defineProps<{
buttonText?: string buttonText?: string
......
...@@ -5,7 +5,7 @@ import UserRule from '@/components/rule/UserRule.vue' ...@@ -5,7 +5,7 @@ import UserRule from '@/components/rule/UserRule.vue'
import EventRule from '@/components/rule/EventRule.vue' import EventRule from '@/components/rule/EventRule.vue'
import UserActionRule from '@/components/rule/UserActionRule.vue' import UserActionRule from '@/components/rule/UserActionRule.vue'
const rules = defineModel<Array<any>>({ default: [] }) const rules = defineModel<Array<any>>({ default: () => [] })
const inputValue = ref('') const inputValue = ref('')
const inputVisible = ref(false) const inputVisible = ref(false)
......
...@@ -4,11 +4,11 @@ import { useRfmStatistics } from '@/composables/useRFMData' ...@@ -4,11 +4,11 @@ import { useRfmStatistics } from '@/composables/useRFMData'
const props = defineProps<{ tagId?: string }>() const props = defineProps<{ tagId?: string }>()
const form = defineModel<any>({ const form = defineModel<any>({
default: { default: () => ({
R: {}, R: {},
F: {}, F: {},
M: {} M: {}
} })
}) })
const { rfmStatistics } = useRfmStatistics(props.tagId || '') const { rfmStatistics } = useRfmStatistics(props.tagId || '')
</script> </script>
......
...@@ -6,7 +6,7 @@ import { stringOperatorList, numberOperatorList, dateOperatorList } from '@/util ...@@ -6,7 +6,7 @@ import { stringOperatorList, numberOperatorList, dateOperatorList } from '@/util
import { searchEventAttrs } from '@/api/base' import { searchEventAttrs } from '@/api/base'
// const userActionRule = ref(inject('userActionRule') as UserActionRule) // const userActionRule = ref(inject('userActionRule') as UserActionRule)
const userActionRule = defineModel<UserActionRule>({ default: { current_logic_operate: 'and', items: [] } }) const userActionRule = defineModel<UserActionRule>({ default: () => ({ current_logic_operate: 'and', items: [] }) })
const { metaEventList } = useMetaEvent() const { metaEventList } = useMetaEvent()
......
...@@ -6,7 +6,7 @@ import { stringOperatorList, numberOperatorList, dateOperatorList } from '@/util ...@@ -6,7 +6,7 @@ import { stringOperatorList, numberOperatorList, dateOperatorList } from '@/util
import { searchMetaMemberAttrs } from '@/api/base' import { searchMetaMemberAttrs } from '@/api/base'
// const userAttrRule = ref(inject('userAttrRule') as UserAttrRule) // const userAttrRule = ref(inject('userAttrRule') as UserAttrRule)
const userAttrRule = defineModel<UserAttrRule>({ default: { current_logic_operate: 'and', items: [] } }) const userAttrRule = defineModel<UserAttrRule>({ default: () => ({ current_logic_operate: 'and', items: [] }) })
const { userAttrList } = useUserAttr() const { userAttrList } = useUserAttr()
......
...@@ -3,7 +3,7 @@ import { getScheduleList, scheduleDelete } from '../api' ...@@ -3,7 +3,7 @@ import { getScheduleList, scheduleDelete } from '../api'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import AppList from '@/components/base/AppList.vue' import AppList from '@/components/base/AppList.vue'
const appList = $ref<InstanceType<typeof AppList> | null>(null) const appList = ref<InstanceType<typeof AppList> | null>(null)
const listOptions = computed(() => { const listOptions = computed(() => {
return { return {
...@@ -44,7 +44,7 @@ const handleDelete = function (item: any) { ...@@ -44,7 +44,7 @@ const handleDelete = function (item: any) {
} }
const refetch = function () { const refetch = function () {
appList?.refetch() appList.value?.refetch()
} }
</script> </script>
......
...@@ -19,7 +19,7 @@ const emit = defineEmits<{ ...@@ -19,7 +19,7 @@ const emit = defineEmits<{
// const formSize = ref('default') // const formSize = ref('default')
const ruleFormRef = ref<FormInstance>() const ruleFormRef = ref<FormInstance>()
const ruleForm = $ref<any>({ const ruleForm = ref<any>({
experiment_id: props.data?.experiment_id, experiment_id: props.data?.experiment_id,
connect_id: props.data?.connect_id, connect_id: props.data?.connect_id,
event_id: '', event_id: '',
...@@ -29,14 +29,14 @@ const ruleForm = $ref<any>({ ...@@ -29,14 +29,14 @@ const ruleForm = $ref<any>({
created_field: '' created_field: ''
}) })
let fieldsValue = $ref<any[]>([]) const fieldsValue = ref<any[]>([])
const submitForm = async (formEl: FormInstance | undefined, bl: string) => { const submitForm = async (formEl: FormInstance | undefined, bl: string) => {
if (!formEl) return if (!formEl) return
await formEl.validate((valid, fields) => { await formEl.validate((valid, fields) => {
if (valid) { if (valid) {
ruleForm.create_data = bl ruleForm.value.create_data = bl
ruleForm.other_fields = JSON.stringify( ruleForm.value.other_fields = JSON.stringify(
fieldsValue.reduce((a: any, b: any) => { fieldsValue.value.reduce((a: any, b: any) => {
a[b.id] = { a[b.id] = {
type: b.rule?.type, type: b.rule?.type,
fixed_value: b.rule?.fixed_value, fixed_value: b.rule?.fixed_value,
...@@ -45,7 +45,7 @@ const submitForm = async (formEl: FormInstance | undefined, bl: string) => { ...@@ -45,7 +45,7 @@ const submitForm = async (formEl: FormInstance | undefined, bl: string) => {
return a return a
}, {}) }, {})
) )
submitScheduleEvent(ruleForm).then((res: any) => { submitScheduleEvent(ruleForm.value).then((res: any) => {
if (res.code === 0) { if (res.code === 0) {
ElMessage({ ElMessage({
message: '保存成功', message: '保存成功',
...@@ -75,13 +75,13 @@ onMounted(() => { ...@@ -75,13 +75,13 @@ onMounted(() => {
// 用户事件改变的时候 // 用户事件改变的时候
const eventChange = function (eId?: string) { const eventChange = function (eId?: string) {
getScheduleEvent({ getScheduleEvent({
experiment_id: ruleForm.experiment_id, experiment_id: ruleForm.value.experiment_id,
connect_id: ruleForm.connect_id, connect_id: ruleForm.value.connect_id,
event_id: eId || ruleForm.event_id event_id: eId || ruleForm.value.event_id
}).then(res => { }).then(res => {
if (res.data) { if (res.data) {
mergeJson(ruleForm, res.data) mergeJson(ruleForm.value, res.data)
fieldsValue = res.data.other_fields.map((item: any) => { fieldsValue.value = res.data.other_fields.map((item: any) => {
if (item?.rule) { if (item?.rule) {
item.rule.type = parseInt(item.rule.type) item.rule.type = parseInt(item.rule.type)
} }
...@@ -101,7 +101,7 @@ const mergeJson = function (target: any, source: any) { ...@@ -101,7 +101,7 @@ const mergeJson = function (target: any, source: any) {
} }
const option = computed(() => { const option = computed(() => {
return fieldsValue.reduce((a: any, b: any) => { return fieldsValue.value.reduce((a: any, b: any) => {
if (parseInt(b.type) === 5) { if (parseInt(b.type) === 5) {
a.push(b) a.push(b)
} }
......
...@@ -99,7 +99,7 @@ const remove = function (item: any, index: number) { ...@@ -99,7 +99,7 @@ const remove = function (item: any, index: number) {
><CirclePlusFilled ><CirclePlusFilled
/></el-icon> /></el-icon>
<el-icon <el-icon
@click="remove(item.rule.rand_value, index)" @click="remove(item.rule.rand_value, Number(index))"
size="20" size="20"
style="margin-left: 10px; cursor: pointer" style="margin-left: 10px; cursor: pointer"
v-if="item.rule.rand_value.length > 1" v-if="item.rule.rand_value.length > 1"
......
...@@ -7,16 +7,16 @@ import { Check } from '@element-plus/icons-vue' ...@@ -7,16 +7,16 @@ import { Check } from '@element-plus/icons-vue'
const props = defineProps<{ data?: StudentFollow }>() const props = defineProps<{ data?: StudentFollow }>()
let step = $ref(1) const step = ref(1)
let logs = $ref<any>([]) const logs = ref<any>([])
watchEffect(() => { watchEffect(() => {
if (props.data?.follow_flag) { if (props.data?.follow_flag) {
step = 3 step.value = 3
} }
if (props.data?.data) { if (props.data?.data) {
if (props.data?.data?.logs && props.data?.data?.logs !== '') { if (props.data?.data?.logs && props.data?.data?.logs !== '') {
console.log(props.data?.data?.logs, '11') console.log(props.data?.data?.logs, '11')
logs = JSON.parse(props.data?.data?.logs) logs.value = JSON.parse(props.data?.data?.logs)
} }
} }
}) })
...@@ -49,7 +49,7 @@ const submitForm = async (formEl: FormInstance | undefined) => { ...@@ -49,7 +49,7 @@ const submitForm = async (formEl: FormInstance | undefined) => {
ruleForm.experiment_connection_id = props.data?.connect_id ruleForm.experiment_connection_id = props.data?.connect_id
studentSubmitForm(ruleForm).then((res: any) => { studentSubmitForm(ruleForm).then((res: any) => {
if (res.code === 0) { if (res.code === 0) {
step = 3 step.value = 3
} }
}) })
} else { } else {
...@@ -58,19 +58,19 @@ const submitForm = async (formEl: FormInstance | undefined) => { ...@@ -58,19 +58,19 @@ const submitForm = async (formEl: FormInstance | undefined) => {
}) })
} }
let textarea = $ref('') const textarea = ref('')
const handleKeyUp = function (e: any) { const handleKeyUp = function (e: any) {
if (e.key === 'Enter' && textarea !== '') { if (e.key === 'Enter' && textarea.value !== '') {
const currentDate = new Date() const currentDate = new Date()
const currentDateTime = currentDate.toLocaleString() const currentDateTime = currentDate.toLocaleString()
console.log(currentDateTime) console.log(currentDateTime)
logs.push({ time: currentDateTime, text: textarea }) logs.value.push({ time: currentDateTime, text: textarea.value })
studentSubmitLog({ studentSubmitLog({
experiment_connection_id: props.data?.connect_id, experiment_connection_id: props.data?.connect_id,
logs: JSON.stringify([{ time: currentDateTime, text: textarea }]), logs: JSON.stringify([{ time: currentDateTime, text: textarea.value }]),
}).then() }).then()
textarea = '' textarea.value = ''
setTimeout(() => { setTimeout(() => {
scrollToBottom() scrollToBottom()
}, 10) }, 10)
...@@ -85,7 +85,7 @@ const scrollToBottom = function () { ...@@ -85,7 +85,7 @@ const scrollToBottom = function () {
} }
const sendChat = function () { const sendChat = function () {
step = 4 step.value = 4
setTimeout(() => { setTimeout(() => {
scrollToBottom() scrollToBottom()
}, 10) }, 10)
......
...@@ -19,7 +19,7 @@ const emit = defineEmits<{ ...@@ -19,7 +19,7 @@ const emit = defineEmits<{
// const formSize = ref('default') // const formSize = ref('default')
const ruleFormRef = ref<FormInstance>() const ruleFormRef = ref<FormInstance>()
const ruleForm = $ref<any>({ const ruleForm = ref<any>({
experiment_id: '', experiment_id: '',
connect_id: '', connect_id: '',
size: 1000, size: 1000,
...@@ -44,23 +44,23 @@ watchEffect(() => { ...@@ -44,23 +44,23 @@ watchEffect(() => {
}) })
} }
} }
mergeJson(ruleForm, props.data) mergeJson(ruleForm.value, props.data)
}) })
const submitForm = async (formEl: FormInstance | undefined, bl: string) => { const submitForm = async (formEl: FormInstance | undefined, bl: string) => {
if (!formEl) return if (!formEl) return
await formEl.validate((valid, fields) => { await formEl.validate((valid, fields) => {
if (valid) { if (valid) {
ruleForm.create_data = bl ruleForm.value.create_data = bl
if (props.data?.other_fields) { if (props.data?.other_fields) {
ruleForm.other_fields = JSON.stringify( ruleForm.value.other_fields = JSON.stringify(
props.data?.other_fields.reduce((a: any, b: any) => { props.data?.other_fields.reduce((a: any, b: any) => {
a[b.id] = { type: b.rule.type, fixed_value: b.rule.fixed_value, rand_value: b.rule.rand_value } a[b.id] = { type: b.rule.type, fixed_value: b.rule.fixed_value, rand_value: b.rule.rand_value }
return a return a
}, {}) }, {})
) )
} }
submitScheduleMember(ruleForm).then((res: any) => { submitScheduleMember(ruleForm.value).then((res: any) => {
if (res.code === 0) { if (res.code === 0) {
ElMessage({ ElMessage({
message: '保存成功', message: '保存成功',
...@@ -83,9 +83,9 @@ const rules = [{ required: true }] ...@@ -83,9 +83,9 @@ const rules = [{ required: true }]
const genderWoman = ref(0) const genderWoman = ref(0)
watchEffect(() => { watchEffect(() => {
if (ruleForm.gender > 100) ruleForm.gender = 100 if (ruleForm.value.gender > 100) ruleForm.value.gender = 100
if (ruleForm.gender < 0) ruleForm.gender = 0 if (ruleForm.value.gender < 0) ruleForm.value.gender = 0
genderWoman.value = 100 - ruleForm.gender genderWoman.value = 100 - ruleForm.value.gender
}) })
</script> </script>
......
...@@ -19,7 +19,7 @@ const EventDataDialog = defineAsyncComponent(() => import('../components/EventDa ...@@ -19,7 +19,7 @@ const EventDataDialog = defineAsyncComponent(() => import('../components/EventDa
const DataProgressDialog = defineAsyncComponent(() => import('../components/DataProgressDialog.vue')) const DataProgressDialog = defineAsyncComponent(() => import('../components/DataProgressDialog.vue'))
const StudentFollowDialog = defineAsyncComponent(() => import('../components/StudentFollowDialog.vue')) const StudentFollowDialog = defineAsyncComponent(() => import('../components/StudentFollowDialog.vue'))
const appList = $ref<InstanceType<typeof AppList> | null>(null) const appList = ref<InstanceType<typeof AppList> | null>(null)
// 列表配置 // 列表配置
const listOptions = computed(() => { const listOptions = computed(() => {
return { return {
...@@ -42,34 +42,34 @@ const listOptions = computed(() => { ...@@ -42,34 +42,34 @@ const listOptions = computed(() => {
// 刷新 // 刷新
function handleRefresh() { function handleRefresh() {
appList?.refetch() appList.value?.refetch()
} }
// 新建链接 // 新建链接
let formVisible = $ref(false) const formVisible = ref(false)
const createConnect = function () { const createConnect = function () {
formData = undefined formData.value = undefined
formVisible = true formVisible.value = true
} }
// 编辑链接 // 编辑链接
let formData = $ref<DetailsProp | undefined>() const formData = ref<DetailsProp | undefined>()
const editConnect = function (id: string) { const editConnect = function (id: string) {
getConnectionDetails({ id: id }).then((res) => { getConnectionDetails({ id: id }).then((res) => {
formData = res.data formData.value = res.data
formVisible = true formVisible.value = true
}) })
} }
// 生成用户数据相关 // 生成用户数据相关
let userDataVisible = $ref(false) const userDataVisible = ref(false)
let userData = $ref<ScheduleMember>() const userData = ref<ScheduleMember>()
const handleGenerateUserData = function (experimentId: string, id: string, name: string) { const handleGenerateUserData = function (experimentId: string, id: string, name: string) {
getScheduleMember({ experiment_id: experimentId, connect_id: id }).then((res: { data: ScheduleMember }) => { getScheduleMember({ experiment_id: experimentId, connect_id: id }).then((res: { data: ScheduleMember }) => {
userData = res.data userData.value = res.data
if (res.data?.other_fields) { if (res.data?.other_fields) {
userData.other_fields = res.data.other_fields.map((item: any) => { userData.value.other_fields = res.data.other_fields.map((item: any) => {
if (item?.rule) { if (item?.rule) {
item.rule.type = parseInt(item.rule.type) item.rule.type = parseInt(item.rule.type)
} }
...@@ -77,47 +77,47 @@ const handleGenerateUserData = function (experimentId: string, id: string, name: ...@@ -77,47 +77,47 @@ const handleGenerateUserData = function (experimentId: string, id: string, name:
}) })
} }
userData.type_name = name userData.value.type_name = name
userData.experiment_id = experimentId userData.value.experiment_id = experimentId
userData.connect_id = id userData.value.connect_id = id
}) })
userDataVisible = true userDataVisible.value = true
} }
// 生成事件数据 // 生成事件数据
let eventDataVisible = $ref(false) const eventDataVisible = ref(false)
let eventData = $ref<any>({}) const eventData = ref<any>({})
const handleGenerateEventData = function (experimentId: string, id: string, events: any, last_event: string) { const handleGenerateEventData = function (experimentId: string, id: string, events: any, last_event: string) {
eventData = { eventData.value = {
experiment_id: experimentId, experiment_id: experimentId,
connect_id: id, connect_id: id,
events: events, events: events,
last_event: last_event, last_event: last_event,
} }
eventDataVisible = true eventDataVisible.value = true
} }
// 数据生成进度 // 数据生成进度
let dataProgressVisible = $ref(false) const dataProgressVisible = ref(false)
const viewDataProgress = function () { const viewDataProgress = function () {
dataProgressVisible = true dataProgressVisible.value = true
} }
// 用户触达 // 用户触达
let studentFollowVisible = $ref(false) const studentFollowVisible = ref(false)
let studentFollowData = $ref<StudentFollow>() const studentFollowData = ref<StudentFollow>()
const handleStudentFollow = function (experimentId: string, id: string, type: string) { const handleStudentFollow = function (experimentId: string, id: string, type: string) {
if (type === '15') { if (type === '15') {
window.open(`https://mall-h5-web.ezijing.com?id=${id}&experiment_id=${route.query.experiment_id}`) window.open(`https://mall-h5-web.ezijing.com?id=${id}&experiment_id=${route.query.experiment_id}`)
} else { } else {
studentFollowVisible = true studentFollowVisible.value = true
getStudentFollow({ experiment_id: experimentId, experiment_connection_id: id }).then((res: any) => { getStudentFollow({ experiment_id: experimentId, experiment_connection_id: id }).then((res: any) => {
if (res.code === 0) { if (res.code === 0) {
const data = res.data const data = res.data
data.connect_id = id data.connect_id = id
data.type = type data.type = type
studentFollowData = data studentFollowData.value = data
} }
}) })
} }
......
...@@ -17,7 +17,7 @@ const emit = defineEmits<{ ...@@ -17,7 +17,7 @@ const emit = defineEmits<{
const statusList = useMapStore().getMapValuesByKey('system_status') const statusList = useMapStore().getMapValuesByKey('system_status')
const appList = $ref<InstanceType<typeof AppList> | null>(null) const appList = ref<InstanceType<typeof AppList> | null>(null)
// 列表配置 // 列表配置
const listOptions = computed(() => { const listOptions = computed(() => {
return { return {
...@@ -40,13 +40,13 @@ const listOptions = computed(() => { ...@@ -40,13 +40,13 @@ const listOptions = computed(() => {
} }
}) })
let multipleSelection = $ref<GroupMember[]>([]) const multipleSelection = ref<GroupMember[]>([])
function handleSelectionChange(selection: GroupMember[]) { function handleSelectionChange(selection: GroupMember[]) {
multipleSelection = selection multipleSelection.value = selection
} }
// 添加 // 添加
function handleAdd() { function handleAdd() {
const ids = multipleSelection.map(item => item.id) const ids = multipleSelection.value.map(item => item.id)
addGroupMembers({ group_id: props.data.id, user_ids: ids }).then(() => { addGroupMembers({ group_id: props.data.id, user_ids: ids }).then(() => {
ElMessage({ message: '添加成功', type: 'success' }) ElMessage({ message: '添加成功', type: 'success' })
emit('update') emit('update')
...@@ -75,7 +75,7 @@ function handleAdd() { ...@@ -75,7 +75,7 @@ function handleAdd() {
</el-row> </el-row>
</el-form> </el-form>
<AppList v-bind="listOptions" ref="appList" @selection-change="handleSelectionChange"> <AppList v-bind="listOptions" ref="appList" @selection-change="handleSelectionChange">
<template #table-status="{ row }: { row: Group }"> <template #table-status="{ row }">
<el-tag :type="row.status === '1' ? 'success' : 'danger'"> <el-tag :type="row.status === '1' ? 'success' : 'danger'">
{{ getNameByValue(row.status, statusList) }} {{ getNameByValue(row.status, statusList) }}
</el-tag> </el-tag>
......
...@@ -16,7 +16,7 @@ const ViewDialog = defineAsyncComponent(() => import('../components/ViewDialog.v ...@@ -16,7 +16,7 @@ const ViewDialog = defineAsyncComponent(() => import('../components/ViewDialog.v
const statusList = useMapStore().getMapValuesByKey('system_status') const statusList = useMapStore().getMapValuesByKey('system_status')
const appList = $ref<InstanceType<typeof AppList> | null>(null) const appList = ref<InstanceType<typeof AppList> | null>(null)
// 列表配置 // 列表配置
const listParams = reactive({ name: '', id: '', status: '', updated_operator: '' }) const listParams = reactive({ name: '', id: '', status: '', updated_operator: '' })
const listOptions = computed(() => { const listOptions = computed(() => {
...@@ -79,26 +79,26 @@ const listOptions = computed(() => { ...@@ -79,26 +79,26 @@ const listOptions = computed(() => {
// 刷新 // 刷新
function handleRefresh() { function handleRefresh() {
appList?.refetch() appList.value?.refetch()
} }
let multipleSelection = $ref<Group[]>([]) const multipleSelection = ref<Group[]>([])
function handleSelectionChange(selection: Group[]) { function handleSelectionChange(selection: Group[]) {
multipleSelection = selection multipleSelection.value = selection
} }
let formVisible = $ref(false) const formVisible = ref(false)
let currentRow = $ref<Partial<Group>>() const currentRow = ref<Partial<Group>>()
// 新建 // 新建
function handleAdd(type: '1' | '2' | '3') { function handleAdd(type: '1' | '2' | '3') {
currentRow = { type } currentRow.value = { type }
formVisible = true formVisible.value = true
} }
// 修改 // 修改
function handleUpdate(row: Group) { function handleUpdate(row: Group) {
currentRow = row currentRow.value = row
formVisible = true formVisible.value = true
} }
// 删除 // 删除
function handleRemove(rows: Group[]) { function handleRemove(rows: Group[]) {
...@@ -110,11 +110,11 @@ function handleRemove(rows: Group[]) { ...@@ -110,11 +110,11 @@ function handleRemove(rows: Group[]) {
}) })
}) })
} }
let viewVisible = $ref(false) const viewVisible = ref(false)
// 查看 // 查看
function handleView(row: Group) { function handleView(row: Group) {
currentRow = row currentRow.value = row
viewVisible = true viewVisible.value = true
} }
</script> </script>
......
...@@ -12,31 +12,31 @@ const materialTypeList = useMapStore().getMapValuesByKey('experiment_marketing_m ...@@ -12,31 +12,31 @@ const materialTypeList = useMapStore().getMapValuesByKey('experiment_marketing_m
const userStore = useUserStore() const userStore = useUserStore()
// 左边展示数据 // 左边展示数据
let leftData = $ref() const leftData = ref()
getExperimentData().then((res) => { getExperimentData().then((res) => {
leftData = res.data leftData.value = res.data
}) })
// 最近活跃客户 // 最近活跃客户
let userList = $ref([]) const userList = ref([])
getMembersList().then((res) => { getMembersList().then((res) => {
userList = res.data.map((element, index) => { userList.value = res.data.map((element, index) => {
element.isActive = index === 0 element.isActive = index === 0
return element return element
}) })
}) })
const activeUser = computed(() => { const activeUser = computed(() => {
return userList.find((item) => item.isActive) return userList.value.find((item) => item.isActive)
}) })
// 最近活跃客户的事件 // 最近活跃客户的事件
let eventData = $ref({ list: [], total: 0 }) const eventData = ref({ list: [], total: 0 })
const eventCurrentPage = ref(1) const eventCurrentPage = ref(1)
const getEvent = function (id) { const getEvent = function (id) {
id = id || activeUser.value?.id id = id || activeUser.value?.id
if (id) { if (id) {
getEventList({ member_id: id, page: eventCurrentPage.value, 'per-page': 4 }).then((res) => { getEventList({ member_id: id, page: eventCurrentPage.value, 'per-page': 4 }).then((res) => {
eventData = res.data eventData.value = res.data
}) })
} }
} }
...@@ -46,7 +46,7 @@ watchEffect(() => { ...@@ -46,7 +46,7 @@ watchEffect(() => {
// 切换客户事件 // 切换客户事件
const handleUser = (item) => { const handleUser = (item) => {
userList?.map((item) => (item.isActive = false && item)) userList.value?.map((item) => (item.isActive = false && item))
item.isActive = true item.isActive = true
eventCurrentPage.value = 1 eventCurrentPage.value = 1
} }
...@@ -61,7 +61,7 @@ const getDate = function (date) { ...@@ -61,7 +61,7 @@ const getDate = function (date) {
// return experimentTypeList.find((item: any) => item.id === id)?.value as string // return experimentTypeList.find((item: any) => item.id === id)?.value as string
// } // }
const currentUser = computed(() => { const currentUser = computed(() => {
return userList?.find((item) => item.isActive) return userList.value?.find((item) => item.isActive)
}) })
const viewEventVisible = ref(false) const viewEventVisible = ref(false)
...@@ -154,7 +154,7 @@ const labelHotOption = computed(() => { ...@@ -154,7 +154,7 @@ const labelHotOption = computed(() => {
// 营销物料分布 // 营销物料分布
const materialOptions = computed(() => { const materialOptions = computed(() => {
if (!leftData?.materials.length) return if (!leftData.value?.materials.length) return
return { return {
grid: { left: '5%', top: '10%', right: '5%', bottom: '5%', containLabel: true }, grid: { left: '5%', top: '10%', right: '5%', bottom: '5%', containLabel: true },
tooltip: { tooltip: {
...@@ -167,7 +167,7 @@ const materialOptions = computed(() => { ...@@ -167,7 +167,7 @@ const materialOptions = computed(() => {
label: { formatter: '{b}\n{d}%' }, label: { formatter: '{b}\n{d}%' },
itemStyle: { borderRadius: 6 }, itemStyle: { borderRadius: 6 },
radius: [0, '70%'], radius: [0, '70%'],
data: leftData.materials.map((item) => { data: leftData.value.materials.map((item) => {
return { name: getNameByValue(item.type, materialTypeList), value: item.num } return { name: getNameByValue(item.type, materialTypeList), value: item.num }
}), }),
}, },
...@@ -177,7 +177,7 @@ const materialOptions = computed(() => { ...@@ -177,7 +177,7 @@ const materialOptions = computed(() => {
// 直播场次分布 // 直播场次分布
const liveNumberOptions = computed(() => { const liveNumberOptions = computed(() => {
if (!leftData?.live_practice_records.length) return if (!leftData.value?.live_practice_records.length) return
return { return {
grid: { left: '5%', top: '10%', right: '5%', bottom: '5%', containLabel: true }, grid: { left: '5%', top: '10%', right: '5%', bottom: '5%', containLabel: true },
tooltip: { tooltip: {
...@@ -190,7 +190,7 @@ const liveNumberOptions = computed(() => { ...@@ -190,7 +190,7 @@ const liveNumberOptions = computed(() => {
label: { formatter: '{b}\n{d}%' }, label: { formatter: '{b}\n{d}%' },
itemStyle: { borderRadius: 6 }, itemStyle: { borderRadius: 6 },
radius: [0, '70%'], radius: [0, '70%'],
data: leftData.live_practice_records.map((item) => { data: leftData.value.live_practice_records.map((item) => {
return { name: item.live_commodity, value: item.num } return { name: item.live_commodity, value: item.num }
}), }),
}, },
......
...@@ -17,12 +17,12 @@ const emit = defineEmits<{ ...@@ -17,12 +17,12 @@ const emit = defineEmits<{
(e: 'update:modelValue', visible: boolean): void (e: 'update:modelValue', visible: boolean): void
}>() }>()
const isUpdate = $computed(() => !!props.data?.id) const isUpdate = computed(() => !!props.data?.id)
const title = $computed(() => (isUpdate ? '修改标签' : '新建标签')) const title = computed(() => (isUpdate.value ? '修改标签' : '新建标签'))
const { typeList } = useLabelType() const { typeList } = useLabelType()
const formRef = $ref<FormInstance>() const formRef = ref<FormInstance>()
const form = reactive({ const form = reactive({
id: '', id: '',
name: '', name: '',
...@@ -58,7 +58,7 @@ const { hasQuestion, teacherTagList } = useQuestion('202') ...@@ -58,7 +58,7 @@ const { hasQuestion, teacherTagList } = useQuestion('202')
// 提交 // 提交
function handleSubmit() { function handleSubmit() {
formRef?.validate().then(() => (isUpdate ? handleUpdate() : handleCreate())) formRef.value?.validate().then(() => (isUpdate.value ? handleUpdate() : handleCreate()))
} }
// 新建 // 新建
function handleCreate() { function handleCreate() {
......
...@@ -29,7 +29,7 @@ const disabled = computed(() => userStore.status.tag_status) ...@@ -29,7 +29,7 @@ const disabled = computed(() => userStore.status.tag_status)
const statusList = useMapStore().getMapValuesByKey('system_status') const statusList = useMapStore().getMapValuesByKey('system_status')
const formRef = $ref<FormInstance>() const formRef = ref<FormInstance>()
const form: any = reactive({ const form: any = reactive({
id: '', id: '',
...@@ -87,7 +87,7 @@ watchEffect(() => fetchInfo()) ...@@ -87,7 +87,7 @@ watchEffect(() => fetchInfo())
// 提交 // 提交
function handleSubmit() { function handleSubmit() {
formRef?.validate().then(handleUpdate) formRef.value?.validate().then(handleUpdate)
} }
// 保存 // 保存
......
...@@ -18,18 +18,18 @@ const LabelTypeFormDialog = defineAsyncComponent(() => import('../components/Lab ...@@ -18,18 +18,18 @@ const LabelTypeFormDialog = defineAsyncComponent(() => import('../components/Lab
const { labelCount, typeList, fetchTypeList } = useLabelType() const { labelCount, typeList, fetchTypeList } = useLabelType()
let formVisible = $ref(false) const formVisible = ref(false)
let currentRow = $ref<LabelType>() const currentRow = ref<LabelType>()
// 新建 // 新建
function handleAdd() { function handleAdd() {
currentRow = undefined currentRow.value = undefined
formVisible = true formVisible.value = true
} }
// 修改 // 修改
function handleUpdate(row: LabelType) { function handleUpdate(row: LabelType) {
currentRow = row currentRow.value = row
formVisible = true formVisible.value = true
} }
// 删除 // 删除
function handleRemove(row: LabelType) { function handleRemove(row: LabelType) {
......
...@@ -13,10 +13,10 @@ const emit = defineEmits<{ ...@@ -13,10 +13,10 @@ const emit = defineEmits<{
(e: 'update:modelValue', visible: boolean): void (e: 'update:modelValue', visible: boolean): void
}>() }>()
const isUpdate = $computed(() => !!props.data?.id) const isUpdate = computed(() => !!props.data?.id)
const title = $computed(() => (isUpdate ? '修改标签目录' : '新建标签目录')) const title = computed(() => (isUpdate.value ? '修改标签目录' : '新建标签目录'))
const formRef = $ref<FormInstance>() const formRef = ref<FormInstance>()
const form = reactive({ id: '', name: '', url: '' }) const form = reactive({ id: '', name: '', url: '' })
watchEffect(() => { watchEffect(() => {
...@@ -28,14 +28,14 @@ const rules = ref<FormRules>({ ...@@ -28,14 +28,14 @@ const rules = ref<FormRules>({
url: [{ required: true, message: '请选择标签目录图标' }] url: [{ required: true, message: '请选择标签目录图标' }]
}) })
const iconColorList = $ref(['#AA593B', '#CD9A23', '#20AE6C', '#196D42', '#614BE8', '#6D4E8B', '#A01578', '#BD2547']) const iconColorList = ref(['#AA593B', '#CD9A23', '#20AE6C', '#196D42', '#614BE8', '#6D4E8B', '#A01578', '#BD2547'])
function handleChangeIcon(color: string) { function handleChangeIcon(color: string) {
form.url = color form.url = color
} }
// 提交 // 提交
function handleSubmit() { function handleSubmit() {
formRef?.validate().then(() => (isUpdate ? handleUpdate() : handleCreate())) formRef.value?.validate().then(() => (isUpdate.value ? handleUpdate() : handleCreate()))
} }
// 新建 // 新建
function handleCreate() { function handleCreate() {
......
...@@ -22,7 +22,7 @@ const aiDialogVisible = ref(false) ...@@ -22,7 +22,7 @@ const aiDialogVisible = ref(false)
const statusList = useMapStore().getMapValuesByKey('system_status') const statusList = useMapStore().getMapValuesByKey('system_status')
const { typeList } = useLabelType() const { typeList } = useLabelType()
const appList = $ref<InstanceType<typeof AppList> | null>(null) const appList = ref<InstanceType<typeof AppList> | null>(null)
// 列表配置 // 列表配置
const listParams = reactive({ name: '', type_id: '', status: '', updated_operator: '' }) const listParams = reactive({ name: '', type_id: '', status: '', updated_operator: '' })
const listOptions = computed(() => { const listOptions = computed(() => {
...@@ -102,21 +102,21 @@ const listOptions = computed(() => { ...@@ -102,21 +102,21 @@ const listOptions = computed(() => {
}) })
// 刷新 // 刷新
function handleRefresh() { function handleRefresh() {
appList?.refetch() appList.value?.refetch()
} }
let formVisible = $ref(false) const formVisible = ref(false)
let currentRow = $ref<Label>() const currentRow = ref<Label>()
// 新建 // 新建
function handleAdd() { function handleAdd() {
currentRow = undefined currentRow.value = undefined
formVisible = true formVisible.value = true
} }
// 修改 // 修改
function handleUpdate(row: Label) { function handleUpdate(row: Label) {
currentRow = row currentRow.value = row
formVisible = true formVisible.value = true
} }
// 删除 // 删除
function handleRemove(row: Label) { function handleRemove(row: Label) {
...@@ -128,39 +128,39 @@ function handleRemove(row: Label) { ...@@ -128,39 +128,39 @@ function handleRemove(row: Label) {
}) })
} }
// 查看 // 查看
let viewVisible = $ref(false) const viewVisible = ref(false)
function handleView(row: Label) { function handleView(row: Label) {
currentRow = row currentRow.value = row
viewVisible = true viewVisible.value = true
} }
// 规则 // 规则
let ruleVisible = $ref(false) const ruleVisible = ref(false)
function handleRule(row: Label) { function handleRule(row: Label) {
currentRow = row currentRow.value = row
ruleVisible = true ruleVisible.value = true
} }
function handleSelect(id: string) { function handleSelect(id: string) {
listParams.type_id = id listParams.type_id = id
nextTick(() => { nextTick(() => {
appList?.refetch() appList.value?.refetch()
}) })
} }
let multipleSelection = $ref<Label[]>([]) const multipleSelection = ref<Label[]>([])
function handleSelectionChange(selection: Label[]) { function handleSelectionChange(selection: Label[]) {
multipleSelection = selection multipleSelection.value = selection
} }
const handleRemoves = async function () { const handleRemoves = async function () {
const ids = multipleSelection.map((item) => item.id) const ids = multipleSelection.value.map((item) => item.id)
await ElMessageBox.confirm('确定要删除选中的标签数据吗?', '提示', { await ElMessageBox.confirm('确定要删除选中的标签数据吗?', '提示', {
confirmButtonText: '确认', confirmButtonText: '确认',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
}) })
await deleteLabels({ ids: JSON.stringify(ids) }) await deleteLabels({ ids: JSON.stringify(ids) })
appList?.refetch(true) appList.value?.refetch(true)
ElMessage({ message: '删除成功', type: 'success' }) ElMessage({ message: '删除成功', type: 'success' })
} }
</script> </script>
......
<script setup> <script setup>
import { Plus, Delete, QuestionFilled } from '@element-plus/icons-vue' import { Plus, Delete, QuestionFilled } from '@element-plus/icons-vue'
import { ElMessage } from 'element-plus' import { ElMessage, useFormDisabled } from 'element-plus'
import { deliveryMode, deliveryTime, orderStockCount } from '@/utils/dictionary' import { deliveryMode, deliveryTime, orderStockCount } from '@/utils/dictionary'
const form = inject('form') const form = inject('form')
const formDisabled = useFormDisabled()
// 初始化规格列表 // 初始化规格列表
if (!form.info.specs) { if (!form.info.specs) {
...@@ -253,7 +254,7 @@ function batchSetReferencePrice() { ...@@ -253,7 +254,7 @@ function batchSetReferencePrice() {
circle circle
size="small" size="small"
@click="removeSpecValue(specIndex, valueIndex)" @click="removeSpecValue(specIndex, valueIndex)"
:disabled="spec.values.length <= 1" :disabled="formDisabled || spec.values.length <= 1"
style="margin-left: 8px" style="margin-left: 8px"
title="删除规格值"> title="删除规格值">
</el-button> </el-button>
...@@ -274,7 +275,7 @@ function batchSetReferencePrice() { ...@@ -274,7 +275,7 @@ function batchSetReferencePrice() {
plain plain
:icon="Plus" :icon="Plus"
@click="addSpec" @click="addSpec"
:disabled="specCount >= maxSpecCount" :disabled="formDisabled || specCount >= maxSpecCount"
v-if="specCount < 1"> v-if="specCount < 1">
添加规格({{ specCount }}/{{ maxSpecCount }}) 添加规格({{ specCount }}/{{ maxSpecCount }})
</el-button> </el-button>
......
...@@ -3,8 +3,10 @@ import { getChuanKitDesignList } from '../api' ...@@ -3,8 +3,10 @@ import { getChuanKitDesignList } from '../api'
import { useUserStore } from '@/stores/user' import { useUserStore } from '@/stores/user'
import { uploadFileByUrl } from '@/utils/upload' import { uploadFileByUrl } from '@/utils/upload'
import { useMediaQuery } from '@vueuse/core' import { useMediaQuery } from '@vueuse/core'
import { useFormDisabled } from 'element-plus'
const isMobile = useMediaQuery('(max-width: 767px)') const isMobile = useMediaQuery('(max-width: 767px)')
const formDisabled = useFormDisabled()
const ChuangKitDesign = defineAsyncComponent(() => import('@/components/ChuangKitDesign.vue')) const ChuangKitDesign = defineAsyncComponent(() => import('@/components/ChuangKitDesign.vue'))
...@@ -96,7 +98,7 @@ async function handleSubmit() { ...@@ -96,7 +98,7 @@ async function handleSubmit() {
<template #footer> <template #footer>
<el-row justify="center"> <el-row justify="center">
<el-button round auto-insert-space @click="$emit('update:modelValue', false)">关闭</el-button> <el-button round auto-insert-space @click="$emit('update:modelValue', false)">关闭</el-button>
<el-button type="primary" round auto-insert-space :disabled="!active" @click="handleSubmit">确定</el-button> <el-button type="primary" round auto-insert-space :disabled="formDisabled || !active" @click="handleSubmit">确定</el-button>
</el-row> </el-row>
</template> </template>
</el-dialog> </el-dialog>
......
...@@ -226,7 +226,7 @@ function handleAIGenerate(index) { ...@@ -226,7 +226,7 @@ function handleAIGenerate(index) {
plain plain
size="small" size="small"
@click="handleAIGenerate(1)" @click="handleAIGenerate(1)"
:disabled="isLoading" :disabled="action === 'view' || isLoading"
:loading="isLoading && aiActive === 1" :loading="isLoading && aiActive === 1"
>AI一键生成</el-button >AI一键生成</el-button
> >
...@@ -246,7 +246,7 @@ function handleAIGenerate(index) { ...@@ -246,7 +246,7 @@ function handleAIGenerate(index) {
plain plain
size="small" size="small"
@click="handleAIGenerate(2)" @click="handleAIGenerate(2)"
:disabled="isLoading" :disabled="action === 'view' || isLoading"
:loading="isLoading && aiActive === 2" :loading="isLoading && aiActive === 2"
>AI一键生成</el-button >AI一键生成</el-button
> >
......
...@@ -64,14 +64,14 @@ watch( ...@@ -64,14 +64,14 @@ watch(
{ immediate: true } { immediate: true }
) )
const { removeNodes, removeEdges, addEdges, edges: parentEdges } = useVueFlow() const { removeNodes, removeEdges, addEdges, updateNodeData, edges: parentEdges } = useVueFlow()
const isCompleted = computed(() => { const isCompleted = computed(() => {
return !!props.data.label return !!props.data.label
}) })
const handleSubmit = async () => { const handleSubmit = async () => {
Object.assign(props.data, { nodes: nodes.value, edges: edges.value }) updateNodeData(props.id, { nodes: nodes.value, edges: edges.value })
flowDialogVisible.value = false flowDialogVisible.value = false
} }
......
<script setup> <script setup>
import { Position, Handle } from '@vue-flow/core' import { Position, Handle, useVueFlow, useNode } from '@vue-flow/core'
const props = defineProps(['label', 'data', 'process', 'disabled']) const props = defineProps(['label', 'data', 'process', 'disabled'])
const { updateNodeData } = useVueFlow()
const { node } = useNode()
const dialogVisible = ref(false) const dialogVisible = ref(false)
...@@ -31,7 +33,7 @@ const conditionList = ['无条件触发', '固定条件触发', '动态条件触 ...@@ -31,7 +33,7 @@ const conditionList = ['无条件触发', '固定条件触发', '动态条件触
const handleSubmit = async () => { const handleSubmit = async () => {
await formRef.value?.validate() await formRef.value?.validate()
Object.assign(props.data, { ...form }) updateNodeData(node.id, { ...form })
dialogVisible.value = false dialogVisible.value = false
} }
......
...@@ -5,12 +5,12 @@ import { getSearchCriteria, getRecordList } from '../api' ...@@ -5,12 +5,12 @@ import { getSearchCriteria, getRecordList } from '../api'
const route = useRoute() const route = useRoute()
let experimentInfo = $ref<ExperimentInfo>() const experimentInfo = ref<ExperimentInfo>()
getSearchCriteria().then((res: { data: { experiment: ExperimentInfo } }) => { getSearchCriteria().then((res: { data: { experiment: ExperimentInfo } }) => {
if (res?.data) { if (res?.data) {
const data = res.data.experiment const data = res.data.experiment
data.teacher_name = data.teacher.reduce((a: any, b: any) => a.push(b.name) && a, []).join(',') data.teacher_name = data.teacher.reduce((a: any, b: any) => a.push(b.name) && a, []).join(',')
experimentInfo = data experimentInfo.value = data
} }
}) })
......
...@@ -5,10 +5,10 @@ import { ElMessage } from 'element-plus' ...@@ -5,10 +5,10 @@ import { ElMessage } from 'element-plus'
const route = useRoute() const route = useRoute()
let data = $ref<any>([]) const data = ref<any>([])
getScore({ record_id: route.query.id }).then((res) => { getScore({ record_id: route.query.id }).then((res) => {
console.log(res.data, 'res.data') console.log(res.data, 'res.data')
data = res.data.map((item: any) => { data.value = res.data.map((item: any) => {
item.score = item.score === '' ? 0 : parseInt(item.score) item.score = item.score === '' ? 0 : parseInt(item.score)
return item return item
}) })
...@@ -36,7 +36,7 @@ const listOptions = computed(() => { ...@@ -36,7 +36,7 @@ const listOptions = computed(() => {
], ],
['show-header']: false, ['show-header']: false,
border: true, border: true,
data: data, data: data.value,
} }
}) })
...@@ -58,7 +58,7 @@ const handleComment = function (row: any) { ...@@ -58,7 +58,7 @@ const handleComment = function (row: any) {
} }
const handleBtn = function () { const handleBtn = function () {
const item = data.find((i: any) => i.id === commentId.value) const item = data.value.find((i: any) => i.id === commentId.value)
item.comment = editorText.value item.comment = editorText.value
editorText.value = '' editorText.value = ''
dialogVisible.value = false dialogVisible.value = false
...@@ -68,7 +68,7 @@ const handleSubmit = function () { ...@@ -68,7 +68,7 @@ const handleSubmit = function () {
updateScore({ updateScore({
experiment_id: route.query.experiment_id, experiment_id: route.query.experiment_id,
record_id: route.query.id, record_id: route.query.id,
score: JSON.stringify(data), score: JSON.stringify(data.value),
}).then(() => { }).then(() => {
ElMessage.success('保存成功') ElMessage.success('保存成功')
}) })
......
...@@ -5,12 +5,12 @@ import Report from '@/modules/market/my/components/Report.vue' ...@@ -5,12 +5,12 @@ import Report from '@/modules/market/my/components/Report.vue'
const route = useRoute() const route = useRoute()
let experimentInfo = $ref<ExperimentInfo>() const experimentInfo = ref<ExperimentInfo>()
getSearchCriteria().then((res: { data: { experiment: ExperimentInfo } }) => { getSearchCriteria().then((res: { data: { experiment: ExperimentInfo } }) => {
if (res?.data) { if (res?.data) {
const data = res.data.experiment const data = res.data.experiment
data.teacher_name = data.teacher.reduce((a: any, b: any) => a.push(b.name) && a, []).join(',') data.teacher_name = data.teacher.reduce((a: any, b: any) => a.push(b.name) && a, []).join(',')
experimentInfo = data experimentInfo.value = data
} }
}) })
...@@ -21,7 +21,7 @@ getRecordList({ sno_number: route.query.snoNumber }).then(res => { ...@@ -21,7 +21,7 @@ getRecordList({ sno_number: route.query.snoNumber }).then(res => {
} }
}) })
const data = $computed(() => { const data = computed(() => {
return detail.value?.details ? JSON.parse(detail.value.details) : {} return detail.value?.details ? JSON.parse(detail.value.details) : {}
}) })
</script> </script>
......
...@@ -65,12 +65,12 @@ const { hasQuestion, teacherMaterialList } = useQuestion(questionType, form.valu ...@@ -65,12 +65,12 @@ const { hasQuestion, teacherMaterialList } = useQuestion(questionType, form.valu
ref="formRef" ref="formRef"
:disabled="action === 'view'"> :disabled="action === 'view'">
<el-form-item label="营销内容类型" prop="type"> <el-form-item label="营销内容类型" prop="type">
<el-radio-group v-model="form.type" :disabled="action === 'update'" @change="form.way = '2'"> <el-radio-group v-model="form.type" :disabled="action === 'view' || action === 'update'" @change="form.way = '2'">
<el-radio <el-radio
v-for="item in materialType" v-for="item in materialType"
:key="item.id" :key="item.id"
:value="item.value" :value="item.value"
:disabled="$route.query.type ? item.value !== $route.query.type : false" :disabled="action === 'view' || action === 'update' || ($route.query.type ? item.value !== $route.query.type : false)"
>{{ item.label }}</el-radio >{{ item.label }}</el-radio
> >
</el-radio-group> </el-radio-group>
......
...@@ -122,7 +122,7 @@ function handleRefresh() { ...@@ -122,7 +122,7 @@ function handleRefresh() {
appList.value?.refetch() appList.value?.refetch()
} }
let dialogVisible = $ref(false) const dialogVisible = ref(false)
// 编辑 // 编辑
const currentRow = ref<MaterialProp>() const currentRow = ref<MaterialProp>()
const handleEdit = function (row: MaterialProp) { const handleEdit = function (row: MaterialProp) {
...@@ -133,7 +133,7 @@ const handleEdit = function (row: MaterialProp) { ...@@ -133,7 +133,7 @@ const handleEdit = function (row: MaterialProp) {
const handleView = function (row: MaterialProp) { const handleView = function (row: MaterialProp) {
materialType.value = row.type materialType.value = row.type
currentRow.value = row currentRow.value = row
dialogVisible = true dialogVisible.value = true
} }
// 删除 // 删除
......
...@@ -18,33 +18,34 @@ const emit = defineEmits<{ ...@@ -18,33 +18,34 @@ const emit = defineEmits<{
}>() }>()
// 属性字段类型 // 属性字段类型
const experimentAttributeOptions = $ref(store.getMapValuesByKey('experiment_attribute_type')) const experimentAttributeOptions = ref(store.getMapValuesByKey('experiment_attribute_type'))
// 添加字段 // 添加字段
const addField = function () { const addField = function () {
tableData.push({ id: '', name: '', english_name: '', type: '', format: '' }) tableData.value.push({ id: '', name: '', english_name: '', type: '', format: '' })
} }
// 删除字段 // 删除字段
const deleteField = function (scope: { $index: number; row: EventAttributesProp }) { const deleteField = function (index: number) {
if (scope.row.isDefault) return const row = tableData.value[index]
if (tableData[scope.$index]?.id === '') { if (!row || row.isDefault) return
tableData.splice(scope.$index, 1) if (row.id === '') {
tableData.value.splice(index, 1)
} else { } else {
// 判断当前属性是否可以删除 // 判断当前属性是否可以删除
getIsDeleteAttribute({ id: scope.row.id }).then((res) => { getIsDeleteAttribute({ id: row.id }).then((res) => {
res.data?.can_delete ? tableData.splice(scope.$index, 1) : ElMessage({ message: '不能删除', type: 'warning' }) res.data?.can_delete ? tableData.value.splice(index, 1) : ElMessage({ message: '不能删除', type: 'warning' })
}) })
} }
} }
// 事件详情 // 事件详情
let eventDetail = $ref<EventDetailProp>() const eventDetail = ref<EventDetailProp>()
onBeforeMount(() => { onBeforeMount(() => {
getMetaEventDetail({ id: props.data?.id || '' }).then((res) => { getMetaEventDetail({ id: props.data?.id || '' }).then((res) => {
eventDetail = res.data eventDetail.value = res.data
tableData = defaultFields.concat(res.data.attributes) tableData.value = defaultFields.concat(res.data.attributes)
}) })
}) })
...@@ -56,7 +57,7 @@ const defaultFields = [ ...@@ -56,7 +57,7 @@ const defaultFields = [
] ]
// 字段 // 字段
let tableData = $ref<EventAttributesProp[]>([]) const tableData = ref<EventAttributesProp[]>([])
// 提交 // 提交
function handleSubmit() { function handleSubmit() {
...@@ -65,8 +66,8 @@ function handleSubmit() { ...@@ -65,8 +66,8 @@ function handleSubmit() {
function handleUpdate() { function handleUpdate() {
const params = { const params = {
id: eventDetail?.id || '', id: eventDetail.value?.id || '',
attributes: JSON.stringify(tableData.filter((item) => !item.isDefault)) attributes: JSON.stringify(tableData.value.filter((item) => !item.isDefault))
} }
updateAttributes(params).then(() => { updateAttributes(params).then(() => {
ElMessage({ message: '保存成功', type: 'success' }) ElMessage({ message: '保存成功', type: 'success' })
...@@ -183,7 +184,7 @@ const popoverText = function (row: any) { ...@@ -183,7 +184,7 @@ const popoverText = function (row: any) {
</el-table-column> </el-table-column>
<el-table-column width="30" v-if="props.data?.can_edit !== '0'"> <el-table-column width="30" v-if="props.data?.can_edit !== '0'">
<template #default="scope"> <template #default="scope">
<div @click="deleteField(scope)" style="display: flex; justify-content: center; cursor: pointer" v-if="!scope.row.isDefault"> <div @click="deleteField(scope.$index)" style="display: flex; justify-content: center; cursor: pointer" v-if="!scope.row.isDefault">
<el-icon size="20"><Close /></el-icon> <el-icon size="20"><Close /></el-icon>
</div> </div>
</template> </template>
......
...@@ -15,14 +15,14 @@ const emit = defineEmits<{ ...@@ -15,14 +15,14 @@ const emit = defineEmits<{
(e: 'update:modelValue', visible: boolean): void (e: 'update:modelValue', visible: boolean): void
}>() }>()
const isUpdate = $computed(() => { const isUpdate = computed(() => {
return !!props.data?.id return !!props.data?.id
}) })
const title = $computed(() => { const title = computed(() => {
return isUpdate ? '修改事件属性' : '新建事件属性' return isUpdate.value ? '修改事件属性' : '新建事件属性'
}) })
const formRef = $ref<FormInstance>() const formRef = ref<FormInstance>()
const form = reactive( const form = reactive(
props.data || { props.data || {
name: '', name: '',
...@@ -40,8 +40,8 @@ const rules = ref<FormRules>({ ...@@ -40,8 +40,8 @@ const rules = ref<FormRules>({
// 提交 // 提交
function handleSubmit() { function handleSubmit() {
formRef?.validate().then(() => { formRef.value?.validate().then(() => {
isUpdate ? handleUpdate() : handleCreate() isUpdate.value ? handleUpdate() : handleCreate()
}) })
} }
......
...@@ -9,12 +9,12 @@ const FormDialog = defineAsyncComponent(() => import('../components/FormDialog.v ...@@ -9,12 +9,12 @@ const FormDialog = defineAsyncComponent(() => import('../components/FormDialog.v
const ViewDialog = defineAsyncComponent(() => import('../components/ViewDialog.vue')) const ViewDialog = defineAsyncComponent(() => import('../components/ViewDialog.vue'))
const FieldDialog = defineAsyncComponent(() => import('../components/FieldDialog.vue')) const FieldDialog = defineAsyncComponent(() => import('../components/FieldDialog.vue'))
const appList = $ref<InstanceType<typeof AppList> | null>(null) const appList = ref<InstanceType<typeof AppList> | null>(null)
// 所属链接选项 // 所属链接选项
let experimentConnectionOptions = $ref<ConnectionOptionProp[]>() const experimentConnectionOptions = ref<ConnectionOptionProp[]>()
getConnectionsList().then(res => { getConnectionsList().then(res => {
experimentConnectionOptions = res.data experimentConnectionOptions.value = res.data
}) })
// 列表配置 // 列表配置
...@@ -30,7 +30,7 @@ const listOptions = computed(() => { ...@@ -30,7 +30,7 @@ const listOptions = computed(() => {
type: 'select', type: 'select',
prop: 'experiment_connection_id', prop: 'experiment_connection_id',
placeholder: '请选择事件所属连接', placeholder: '请选择事件所属连接',
options: experimentConnectionOptions, options: experimentConnectionOptions.value,
labelKey: 'type_name', labelKey: 'type_name',
valueKey: 'id' valueKey: 'id'
}, },
...@@ -69,29 +69,29 @@ const listOptions = computed(() => { ...@@ -69,29 +69,29 @@ const listOptions = computed(() => {
// 刷新 // 刷新
function handleRefresh() { function handleRefresh() {
appList?.refetch() appList.value?.refetch()
} }
let formVisible = $ref(false) const formVisible = ref(false)
let currentRow = $ref<EventProp>() const currentRow = ref<EventProp>()
// 新建 // 新建
function handleAdd() { function handleAdd() {
currentRow = undefined currentRow.value = undefined
formVisible = true formVisible.value = true
} }
// 修改 // 修改
function handleUpdate(row: EventProp) { function handleUpdate(row: EventProp) {
currentRow = row currentRow.value = row
formVisible = true formVisible.value = true
} }
let viewVisible = $ref(false) const viewVisible = ref(false)
// 查看 // 查看
function handleView(row: EventProp) { function handleView(row: EventProp) {
currentRow = row currentRow.value = row
viewVisible = true viewVisible.value = true
} }
// 删除 // 删除
...@@ -105,10 +105,10 @@ function handleRemove(row: EventProp) { ...@@ -105,10 +105,10 @@ function handleRemove(row: EventProp) {
} }
// 字段 // 字段
let fieldVisible = $ref(false) const fieldVisible = ref(false)
const handleField = function (row: EventProp) { const handleField = function (row: EventProp) {
currentRow = row currentRow.value = row
fieldVisible = true fieldVisible.value = true
} }
</script> </script>
......
...@@ -18,14 +18,14 @@ const emit = defineEmits<{ ...@@ -18,14 +18,14 @@ const emit = defineEmits<{
(e: 'update:modelValue', visible: boolean): void (e: 'update:modelValue', visible: boolean): void
}>() }>()
const isUpdate = $computed(() => { const isUpdate = computed(() => {
return !!props.data?.id return !!props.data?.id
}) })
const title = $computed(() => { const title = computed(() => {
return isUpdate ? '修改用户属性' : '新建用户属性' return isUpdate.value ? '修改用户属性' : '新建用户属性'
}) })
const formRef = $ref<FormInstance>() const formRef = ref<FormInstance>()
const form = reactive( const form = reactive(
props.data || { props.data || {
name: '', name: '',
...@@ -49,8 +49,8 @@ const rules = ref<FormRules>({ ...@@ -49,8 +49,8 @@ const rules = ref<FormRules>({
// 提交 // 提交
function handleSubmit() { function handleSubmit() {
formRef?.validate().then(() => { formRef.value?.validate().then(() => {
isUpdate ? handleUpdate() : handleCreate() isUpdate.value ? handleUpdate() : handleCreate()
}) })
} }
...@@ -72,8 +72,8 @@ function handleUpdate() { ...@@ -72,8 +72,8 @@ function handleUpdate() {
} }
// 属性字段类型 // 属性字段类型
const experimentAttributeOptions = $ref(store.getMapValuesByKey('experiment_attribute_type')) const experimentAttributeOptions = ref(store.getMapValuesByKey('experiment_attribute_type'))
const membersCategory = $ref(store.getMapValuesByKey('experiment_meta_members_category')) const membersCategory = ref(store.getMapValuesByKey('experiment_meta_members_category'))
// 属性字段类型选择后->格式的placeholder改变 // 属性字段类型选择后->格式的placeholder改变
const formatPlaceholder = computed(() => { const formatPlaceholder = computed(() => {
......
...@@ -12,7 +12,7 @@ const store = useMapStore() ...@@ -12,7 +12,7 @@ const store = useMapStore()
const FormDialog = defineAsyncComponent(() => import('../components/FormDialog.vue')) const FormDialog = defineAsyncComponent(() => import('../components/FormDialog.vue'))
const ViewDialog = defineAsyncComponent(() => import('../components/ViewDialog.vue')) const ViewDialog = defineAsyncComponent(() => import('../components/ViewDialog.vue'))
const appList = $ref<InstanceType<typeof AppList> | null>(null) const appList = ref<InstanceType<typeof AppList> | null>(null)
// 列表配置 // 列表配置
const listOptions = computed(() => { const listOptions = computed(() => {
return { return {
...@@ -70,29 +70,29 @@ const listOptions = computed(() => { ...@@ -70,29 +70,29 @@ const listOptions = computed(() => {
// 刷新 // 刷新
function handleRefresh() { function handleRefresh() {
appList?.refetch() appList.value?.refetch()
} }
let formVisible = $ref(false) const formVisible = ref(false)
let currentRow = $ref<UserProp>() const currentRow = ref<UserProp>()
// 新建 // 新建
function handleAdd() { function handleAdd() {
currentRow = undefined currentRow.value = undefined
formVisible = true formVisible.value = true
} }
// 修改 // 修改
function handleUpdate(row: UserProp) { function handleUpdate(row: UserProp) {
currentRow = row currentRow.value = row
formVisible = true formVisible.value = true
} }
let viewVisible = $ref(false) const viewVisible = ref(false)
// 查看 // 查看
function handleView(row: UserProp) { function handleView(row: UserProp) {
currentRow = row currentRow.value = row
viewVisible = true viewVisible.value = true
} }
// 删除 // 删除
......
...@@ -24,12 +24,12 @@ const emit = defineEmits<{ ...@@ -24,12 +24,12 @@ const emit = defineEmits<{
const typeList = useMapStore().getMapValuesByKey('strategy_type') const typeList = useMapStore().getMapValuesByKey('strategy_type')
const industryList = useMapStore().getMapValuesByKey('strategy_industry') const industryList = useMapStore().getMapValuesByKey('strategy_industry')
const isUpdate = $computed(() => !!props.data?.id) const isUpdate = computed(() => !!props.data?.id)
const title = $computed(() => (isUpdate ? '修改运营策略' : '新建运营策略')) const title = computed(() => (isUpdate.value ? '修改运营策略' : '新建运营策略'))
const { connectionList } = useConnection() const { connectionList } = useConnection()
const formRef = $ref<FormInstance>() const formRef = ref<FormInstance>()
const form: any = reactive({ const form: any = reactive({
id: '', id: '',
name: '', name: '',
...@@ -70,7 +70,7 @@ const rules = ref<FormRules>({ ...@@ -70,7 +70,7 @@ const rules = ref<FormRules>({
// 提交 // 提交
function handleSubmit() { function handleSubmit() {
formRef?.validate().then(() => (isUpdate ? handleUpdate() : handleCreate())) formRef.value?.validate().then(() => (isUpdate.value ? handleUpdate() : handleCreate()))
} }
// 新建 // 新建
function handleCreate() { function handleCreate() {
......
...@@ -20,12 +20,12 @@ defineEmits<{ ...@@ -20,12 +20,12 @@ defineEmits<{
const typeList = useMapStore().getMapValuesByKey('strategy_type') const typeList = useMapStore().getMapValuesByKey('strategy_type')
const industryList = useMapStore().getMapValuesByKey('strategy_industry') const industryList = useMapStore().getMapValuesByKey('strategy_industry')
const isUpdate = $computed(() => !!props.data?.id) const isUpdate = computed(() => !!props.data?.id)
const title = $computed(() => (isUpdate ? '修改运营策略' : '新建运营策略')) const title = computed(() => (isUpdate.value ? '修改运营策略' : '新建运营策略'))
const { connectionList } = useConnection() const { connectionList } = useConnection()
const formRef = $ref<FormInstance>() const formRef = ref<FormInstance>()
const form: any = reactive({ const form: any = reactive({
id: '', id: '',
name: '', name: '',
...@@ -65,12 +65,12 @@ watchEffect(() => fetchInfo()) ...@@ -65,12 +65,12 @@ watchEffect(() => fetchInfo())
<el-input v-model="form.name" placeholder="请输入" /> <el-input v-model="form.name" placeholder="请输入" />
</el-form-item> </el-form-item>
<el-form-item label="行业" prop="industry"> <el-form-item label="行业" prop="industry">
<el-select v-model="form.industry" style="width: 100%" :disabled="isUpdate"> <el-select v-model="form.industry" style="width: 100%">
<el-option v-for="item in industryList" :key="item.value" :label="item.label" :value="item.value"></el-option> <el-option v-for="item in industryList" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="策略类型" prop="type"> <el-form-item label="策略类型" prop="type">
<el-select v-model="form.type" style="width: 100%" :disabled="isUpdate"> <el-select v-model="form.type" style="width: 100%">
<el-option v-for="item in typeList" :key="item.value" :label="item.label" :value="item.value"></el-option> <el-option v-for="item in typeList" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -79,8 +79,7 @@ watchEffect(() => fetchInfo()) ...@@ -79,8 +79,7 @@ watchEffect(() => fetchInfo())
<el-radio <el-radio
v-for="item in updateStatusRuleList" v-for="item in updateStatusRuleList"
:key="item.value" :key="item.value"
:value="item.value" :value="item.value">
:disabled="item.value === '1'">
{{ item.label }} {{ item.label }}
</el-radio> </el-radio>
</el-radio-group> </el-radio-group>
......
...@@ -18,7 +18,7 @@ const typeList = useMapStore().getMapValuesByKey('strategy_type') ...@@ -18,7 +18,7 @@ const typeList = useMapStore().getMapValuesByKey('strategy_type')
const industryList = useMapStore().getMapValuesByKey('strategy_industry') const industryList = useMapStore().getMapValuesByKey('strategy_industry')
const statusList = useMapStore().getMapValuesByKey('system_status') const statusList = useMapStore().getMapValuesByKey('system_status')
const appList = $ref<InstanceType<typeof AppList> | null>(null) const appList = ref<InstanceType<typeof AppList> | null>(null)
// 列表配置 // 列表配置
const listParams = reactive({ name: '', type_id: '', status: '', updated_operator: '' }) const listParams = reactive({ name: '', type_id: '', status: '', updated_operator: '' })
const listOptions = computed(() => { const listOptions = computed(() => {
...@@ -98,21 +98,21 @@ const listOptions = computed(() => { ...@@ -98,21 +98,21 @@ const listOptions = computed(() => {
}) })
// 刷新 // 刷新
function handleRefresh() { function handleRefresh() {
appList?.refetch() appList.value?.refetch()
} }
let formVisible = $ref(false) const formVisible = ref(false)
let currentRow = $ref<Strategy>() const currentRow = ref<Strategy>()
// 新建 // 新建
function handleAdd() { function handleAdd() {
currentRow = undefined currentRow.value = undefined
formVisible = true formVisible.value = true
} }
// 修改 // 修改
function handleUpdate(row: Strategy) { function handleUpdate(row: Strategy) {
currentRow = row currentRow.value = row
formVisible = true formVisible.value = true
} }
// 删除 // 删除
function handleRemove(row: Strategy) { function handleRemove(row: Strategy) {
...@@ -124,26 +124,26 @@ function handleRemove(row: Strategy) { ...@@ -124,26 +124,26 @@ function handleRemove(row: Strategy) {
}) })
} }
// 查看 // 查看
let viewVisible = $ref(false) const viewVisible = ref(false)
function handleView(row: Strategy) { function handleView(row: Strategy) {
currentRow = row currentRow.value = row
viewVisible = true viewVisible.value = true
} }
let multipleSelection = $ref<Strategy[]>([]) const multipleSelection = ref<Strategy[]>([])
function handleSelectionChange(selection: Strategy[]) { function handleSelectionChange(selection: Strategy[]) {
multipleSelection = selection multipleSelection.value = selection
} }
const handleRemoves = async function () { const handleRemoves = async function () {
const ids = multipleSelection.map((item) => item.id) const ids = multipleSelection.value.map((item) => item.id)
await ElMessageBox.confirm('确定要删除选中的策略数据吗?', '提示', { await ElMessageBox.confirm('确定要删除选中的策略数据吗?', '提示', {
confirmButtonText: '确认', confirmButtonText: '确认',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
}) })
await deleteStrategy({ id: ids.join(',') }) await deleteStrategy({ id: ids.join(',') })
appList?.refetch(true) appList.value?.refetch(true)
ElMessage({ message: '删除成功', type: 'success' }) ElMessage({ message: '删除成功', type: 'success' })
} }
</script> </script>
......
...@@ -58,9 +58,9 @@ function handleSubmit() { ...@@ -58,9 +58,9 @@ function handleSubmit() {
} }
// 配置 // 配置
let configVisible = $ref(false) const configVisible = ref(false)
function handleConfig() { function handleConfig() {
configVisible = true configVisible.value = true
} }
function handleConnectionUpdate(value: string[]) { function handleConnectionUpdate(value: string[]) {
if (!detail.value) return if (!detail.value) return
......
...@@ -13,10 +13,10 @@ const emit = defineEmits<{ ...@@ -13,10 +13,10 @@ const emit = defineEmits<{
(e: 'update:modelValue', visible: boolean): void (e: 'update:modelValue', visible: boolean): void
}>() }>()
const isUpdate = $computed(() => !!props.data?.id) const isUpdate = computed(() => !!props.data?.id)
const title = $computed(() => (isUpdate ? '修改旅程模板' : '新建旅程模板')) const title = computed(() => (isUpdate.value ? '修改旅程模板' : '新建旅程模板'))
const formRef = $ref<FormInstance>() const formRef = ref<FormInstance>()
const form = reactive({ const form = reactive({
id: '', id: '',
name: '', name: '',
...@@ -38,7 +38,7 @@ const rules = ref<FormRules>({ ...@@ -38,7 +38,7 @@ const rules = ref<FormRules>({
// 提交 // 提交
function handleSubmit() { function handleSubmit() {
formRef?.validate().then(() => (isUpdate ? handleUpdate() : handleCreate())) formRef.value?.validate().then(() => (isUpdate.value ? handleUpdate() : handleCreate()))
} }
// 新建 // 新建
function handleCreate() { function handleCreate() {
......
...@@ -13,7 +13,7 @@ const GenerateRule = defineAsyncComponent(() => import('../components/GenerateRu ...@@ -13,7 +13,7 @@ const GenerateRule = defineAsyncComponent(() => import('../components/GenerateRu
const statusList = useMapStore().getMapValuesByKey('system_status') const statusList = useMapStore().getMapValuesByKey('system_status')
const appList = $ref<InstanceType<typeof AppList> | null>(null) const appList = ref<InstanceType<typeof AppList> | null>(null)
// 列表配置 // 列表配置
const listOptions = computed(() => { const listOptions = computed(() => {
return { return {
...@@ -61,46 +61,46 @@ const listOptions = computed(() => { ...@@ -61,46 +61,46 @@ const listOptions = computed(() => {
// 刷新 // 刷新
function handleRefresh() { function handleRefresh() {
appList?.refetch() appList.value?.refetch()
} }
let formVisible = $ref(false) const formVisible = ref(false)
let currentRow = $ref<TripTemplate>() const currentRow = ref<TripTemplate>()
// 新建 // 新建
function handleAdd() { function handleAdd() {
currentRow = undefined currentRow.value = undefined
formVisible = true formVisible.value = true
} }
// 修改 // 修改
function handleUpdate(row: TripTemplate) { function handleUpdate(row: TripTemplate) {
currentRow = row currentRow.value = row
formVisible = true formVisible.value = true
} }
// 查看 // 查看
let viewVisible = $ref(false) const viewVisible = ref(false)
function handleView(row: TripTemplate) { function handleView(row: TripTemplate) {
currentRow = row currentRow.value = row
viewVisible = true viewVisible.value = true
} }
// 配置 // 配置
let configVisible = $ref(false) const configVisible = ref(false)
const router = useRouter() const router = useRouter()
function handleConfig(row: TripTemplate) { function handleConfig(row: TripTemplate) {
// 自由旅程 // 自由旅程
if (row.type === '2') { if (row.type === '2') {
router.push(`/trip/template/${row.id}`) router.push(`/trip/template/${row.id}`)
} else { } else {
currentRow = row currentRow.value = row
configVisible = true configVisible.value = true
} }
} }
let ruleVisible = $ref(false) const ruleVisible = ref(false)
function handleRule(row: TripTemplate) { function handleRule(row: TripTemplate) {
currentRow = row currentRow.value = row
ruleVisible = true ruleVisible.value = true
} }
</script> </script>
......
...@@ -61,9 +61,9 @@ function handleSubmit() { ...@@ -61,9 +61,9 @@ function handleSubmit() {
} }
// 配置 // 配置
let configVisible = $ref(false) const configVisible = ref(false)
function handleConfig() { function handleConfig() {
configVisible = true configVisible.value = true
} }
function handleChantTriggerStatus(status: 0 | 1) { function handleChantTriggerStatus(status: 0 | 1) {
......
...@@ -15,18 +15,18 @@ onMounted(() => { ...@@ -15,18 +15,18 @@ onMounted(() => {
}) })
// 链接列表(所属链接选项) // 链接列表(所属链接选项)
let connectionOptions = $ref<ConnectionsProp[]>() const connectionOptions = ref<ConnectionsProp[]>()
const getConnectionsList = function () { const getConnectionsList = function () {
getMemberConnectionsList().then((res: { data: ConnectionsProp[] }) => { getMemberConnectionsList().then((res: { data: ConnectionsProp[] }) => {
connectionOptions = res.data connectionOptions.value = res.data
}) })
} }
// 用户属性 // 用户属性
let fieldsList = $ref<MemberFieldsProp[]>([]) const fieldsList = ref<MemberFieldsProp[]>([])
const getFieldsList = function () { const getFieldsList = function () {
getMemberFieldsList().then((res: { data: MemberFieldsProp[] }) => { getMemberFieldsList().then((res: { data: MemberFieldsProp[] }) => {
fieldsList = res.data.map((item: any) => { fieldsList.value = res.data.map((item: any) => {
item.value = '' item.value = ''
if (props.data) { if (props.data) {
item.value = props.data?.fields[item.id] item.value = props.data?.fields[item.id]
...@@ -45,7 +45,7 @@ const emit = defineEmits<{ ...@@ -45,7 +45,7 @@ const emit = defineEmits<{
(e: 'update:modelValue', visible: boolean): void (e: 'update:modelValue', visible: boolean): void
}>() }>()
const form = $ref( const form = ref(
props.data || { props.data || {
name: '', name: '',
status: '1', status: '1',
...@@ -65,11 +65,11 @@ const rules = ref<FormRules>({ ...@@ -65,11 +65,11 @@ const rules = ref<FormRules>({
// 提交 // 提交
const submitForm = (formEl: FormInstance | undefined) => { const submitForm = (formEl: FormInstance | undefined) => {
const fields = fieldsList.reduce((a: any, b: { id: string; value: string }) => { const fields = fieldsList.value.reduce((a: any, b: { id: string; value: string }) => {
a[b.id] = b.value a[b.id] = b.value
return a return a
}, {}) }, {})
const params = { ...form, fields: fields } const params = { ...form.value, fields: fields }
if (!formEl) return if (!formEl) return
formEl.validate(valid => { formEl.validate(valid => {
if (valid) { if (valid) {
...@@ -88,7 +88,7 @@ const submitForm = (formEl: FormInstance | undefined) => { ...@@ -88,7 +88,7 @@ const submitForm = (formEl: FormInstance | undefined) => {
}) })
.catch((res: any) => { .catch((res: any) => {
ElMessage.closeAll() ElMessage.closeAll()
ElMessage.error(fieldsList.find((item: any) => item.id === res.data.error_field)?.name + res.message) ElMessage.error(fieldsList.value.find((item: any) => item.id === res.data.error_field)?.name + res.message)
}) })
} }
} else { } else {
......
...@@ -17,8 +17,8 @@ const emit = defineEmits<{ ...@@ -17,8 +17,8 @@ const emit = defineEmits<{
(e: 'update:modelValue', visible: boolean): void (e: 'update:modelValue', visible: boolean): void
}>() }>()
const formRef = $ref<FormInstance>() const formRef = ref<FormInstance>()
const form = $ref( const form = ref(
props.data || { props.data || {
experiment_meta_event_id: '' experiment_meta_event_id: ''
} }
...@@ -28,10 +28,10 @@ const rules = ref<FormRules>({ ...@@ -28,10 +28,10 @@ const rules = ref<FormRules>({
experiment_meta_event_id: [{ required: true, message: '请选择' }] experiment_meta_event_id: [{ required: true, message: '请选择' }]
}) })
let eventList = $ref<EventProp[]>() const eventList = ref<EventProp[]>()
onMounted(() => { onMounted(() => {
getEventList().then(res => { getEventList().then(res => {
eventList = res.data.map( eventList.value = res.data.map(
(item: any) => (item: any) =>
item.attributes.map((cItem: any) => item.attributes.map((cItem: any) =>
props.data ? (cItem.value = JSON.parse(props.data.fields)[cItem.id]) : (cItem.value = '') && cItem props.data ? (cItem.value = JSON.parse(props.data.fields)[cItem.id]) : (cItem.value = '') && cItem
...@@ -42,7 +42,7 @@ onMounted(() => { ...@@ -42,7 +42,7 @@ onMounted(() => {
// 属性 // 属性
const eventAttributes = computed(() => { const eventAttributes = computed(() => {
return eventList?.find(item => item.id === form.experiment_meta_event_id)?.attributes return eventList.value?.find(item => item.id === form.value.experiment_meta_event_id)?.attributes
}) })
// 提交 // 提交
...@@ -69,7 +69,7 @@ const submitForm = (formEl: FormInstance | undefined) => { ...@@ -69,7 +69,7 @@ const submitForm = (formEl: FormInstance | undefined) => {
console.log(data, 'data') console.log(data, 'data')
const params = { const params = {
experiment_member_id: route.query?.user_id as '', experiment_member_id: route.query?.user_id as '',
experiment_meta_event_id: form.experiment_meta_event_id, experiment_meta_event_id: form.value.experiment_meta_event_id,
fields: attributes fields: attributes
} }
createEvent(params).then(() => { createEvent(params).then(() => {
......
...@@ -12,7 +12,7 @@ const emit = defineEmits<{ ...@@ -12,7 +12,7 @@ const emit = defineEmits<{
(e: 'update:modelValue', visible: boolean): void (e: 'update:modelValue', visible: boolean): void
}>() }>()
const formRef = $ref<FormInstance>() const formRef = ref<FormInstance>()
const form = reactive({ const form = reactive({
event_id: '' event_id: ''
}) })
...@@ -22,15 +22,15 @@ const rules = ref<any>({ ...@@ -22,15 +22,15 @@ const rules = ref<any>({
}) })
// 选择事件 // 选择事件
let eventList = $ref<EventProp[]>() const eventList = ref<EventProp[]>()
onMounted(() => { onMounted(() => {
getEventList().then(res => { getEventList().then(res => {
eventList = res.data eventList.value = res.data
}) })
}) })
const connectionName = computed(() => { const connectionName = computed(() => {
return eventList?.find((item: EventProp) => item.id === form.event_id)?.connection_name return eventList.value?.find((item: EventProp) => item.id === form.event_id)?.connection_name
}) })
// 下载数据模板 // 下载数据模板
...@@ -43,8 +43,8 @@ const downloadTemplate = function () { ...@@ -43,8 +43,8 @@ const downloadTemplate = function () {
// 上传 // 上传
const fetchFileUpload = () => { const fetchFileUpload = () => {
if (fileData[0]) { if (fileData.value[0]) {
const params = Object.assign(form, fileData[0]) const params = Object.assign(form, fileData.value[0])
importEvent(params).then(() => { importEvent(params).then(() => {
ElMessage.success('导入数据成功') ElMessage.success('导入数据成功')
emit('update') emit('update')
...@@ -60,7 +60,7 @@ const fetchFileUpload = () => { ...@@ -60,7 +60,7 @@ const fetchFileUpload = () => {
// }) // })
} }
const fileData = $ref<any>([]) const fileData = ref<any>([])
</script> </script>
<template> <template>
......
...@@ -11,7 +11,7 @@ const emit = defineEmits<{ ...@@ -11,7 +11,7 @@ const emit = defineEmits<{
(e: 'update'): void (e: 'update'): void
(e: 'update:modelValue', visible: boolean): void (e: 'update:modelValue', visible: boolean): void
}>() }>()
const formRef = $ref<FormInstance>() const formRef = ref<FormInstance>()
const form = reactive({ const form = reactive({
connection_id: '', connection_id: '',
groups_id: '' groups_id: ''
...@@ -22,15 +22,15 @@ const rules = ref<any>({ ...@@ -22,15 +22,15 @@ const rules = ref<any>({
}) })
// 链接列表 // 链接列表
let connectionList = $ref<ConnectionsProp[]>() const connectionList = ref<ConnectionsProp[]>()
// 群组列表 // 群组列表
let groupList = $ref<{ name: string; id: string }[]>() const groupList = ref<{ name: string; id: string }[]>()
onMounted(() => { onMounted(() => {
getMemberConnectionsList().then(res => { getMemberConnectionsList().then(res => {
connectionList = res.data connectionList.value = res.data
}) })
getMemberGroups().then(res => { getMemberGroups().then(res => {
groupList = res.data groupList.value = res.data
}) })
}) })
...@@ -41,8 +41,8 @@ const downloadTemplate = function () { ...@@ -41,8 +41,8 @@ const downloadTemplate = function () {
// 上传 // 上传
const fetchFileUpload = () => { const fetchFileUpload = () => {
if (fileData[0]) { if (fileData.value[0]) {
const params = Object.assign(form, fileData[0]) const params = Object.assign(form, fileData.value[0])
importMember(params).then(() => { importMember(params).then(() => {
ElMessage.success('导入数据成功') ElMessage.success('导入数据成功')
emit('update') emit('update')
...@@ -51,7 +51,7 @@ const fetchFileUpload = () => { ...@@ -51,7 +51,7 @@ const fetchFileUpload = () => {
} }
} }
const fileData = $ref<any>([]) const fileData = ref<any>([])
</script> </script>
<template> <template>
......
...@@ -50,10 +50,10 @@ const bytesToSize = (bytes: number) => { ...@@ -50,10 +50,10 @@ const bytesToSize = (bytes: number) => {
return (bytes / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i] return (bytes / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i]
} }
const appList = $ref<InstanceType<typeof AppList> | null>(null) const appList = ref<InstanceType<typeof AppList> | null>(null)
const refetch = function () { const refetch = function () {
appList?.refetch() appList.value?.refetch()
} }
</script> </script>
<template> <template>
......
...@@ -8,9 +8,9 @@ import type { MemberProp, AttributesProp } from '../types' ...@@ -8,9 +8,9 @@ import type { MemberProp, AttributesProp } from '../types'
const route = useRoute() const route = useRoute()
const appList = $ref<InstanceType<typeof AppList> | null>(null) const appList = ref<InstanceType<typeof AppList> | null>(null)
let userInfo = $ref<MemberProp>() const userInfo = ref<MemberProp>()
// 列表配置 // 列表配置
const listOptions = computed(() => { const listOptions = computed(() => {
return { return {
...@@ -18,7 +18,7 @@ const listOptions = computed(() => { ...@@ -18,7 +18,7 @@ const listOptions = computed(() => {
httpRequest: getMemberEventList, httpRequest: getMemberEventList,
params: { id: route.query.user_id }, params: { id: route.query.user_id },
callback: (data: any) => { callback: (data: any) => {
userInfo = data userInfo.value = data
return data.events return data.events
} }
}, },
...@@ -35,18 +35,18 @@ const listOptions = computed(() => { ...@@ -35,18 +35,18 @@ const listOptions = computed(() => {
// 刷新 // 刷新
function handleRefresh() { function handleRefresh() {
appList?.refetch() appList.value?.refetch()
} }
// 事件弹窗 // 事件弹窗
let eventsVisible = $ref(false) const eventsVisible = ref(false)
// 编辑 // 编辑
let currentRow = $ref<AttributesProp>() const currentRow = ref<AttributesProp>()
const handleEdit = function (row: AttributesProp) { const handleEdit = function (row: AttributesProp) {
row.isView = false row.isView = false
currentRow = row currentRow.value = row
eventsVisible = true eventsVisible.value = true
} }
// 删除 // 删除
...@@ -61,15 +61,15 @@ function handleRemove(row: AttributesProp) { ...@@ -61,15 +61,15 @@ function handleRemove(row: AttributesProp) {
// 新建 // 新建
const handleAdd = function () { const handleAdd = function () {
currentRow = undefined currentRow.value = undefined
eventsVisible = true eventsVisible.value = true
} }
// 查看 // 查看
const handleView = function (row: AttributesProp) { const handleView = function (row: AttributesProp) {
row.isView = true row.isView = true
currentRow = row currentRow.value = row
eventsVisible = true eventsVisible.value = true
} }
</script> </script>
......
...@@ -19,13 +19,13 @@ const userId = computed(() => { ...@@ -19,13 +19,13 @@ const userId = computed(() => {
}) })
// 画像数据 // 画像数据
let data = $ref<ImageProp>() const data = ref<ImageProp>()
// 属性 // 属性
let fieldsList = $ref<MemberFieldsProp[]>([]) const fieldsList = ref<MemberFieldsProp[]>([])
onMounted(() => { onMounted(() => {
// 画像 // 画像
getMemberImage({ id: userId.value, 'per-page': 100 }).then((res) => { getMemberImage({ id: userId.value, 'per-page': 100 }).then((res) => {
data = res.data data.value = res.data
getFields(res.data) getFields(res.data)
}) })
// 属性 // 属性
...@@ -33,7 +33,7 @@ onMounted(() => { ...@@ -33,7 +33,7 @@ onMounted(() => {
const getFields = function (data: { fields: any }) { const getFields = function (data: { fields: any }) {
getMemberFieldsList().then((res) => { getMemberFieldsList().then((res) => {
fieldsList = res.data.map((item: MemberFieldsProp) => { fieldsList.value = res.data.map((item: MemberFieldsProp) => {
if (data.fields[item.id]) { if (data.fields[item.id]) {
item.value = data.fields[item.id] item.value = data.fields[item.id]
item.isShow = true item.isShow = true
......
...@@ -20,13 +20,13 @@ const router = useRouter() ...@@ -20,13 +20,13 @@ const router = useRouter()
const route = useRoute() const route = useRoute()
const appList = $ref<InstanceType<typeof AppList> | null>(null) const appList = ref<InstanceType<typeof AppList> | null>(null)
// 链接列表(所属链接选项) // 链接列表(所属链接选项)
let connectionOptions = $ref<ConnectionsProp[]>() const connectionOptions = ref<ConnectionsProp[]>()
const getConnectionsList = function () { const getConnectionsList = function () {
getMemberConnectionsList().then((res: { data: ConnectionsProp[] }) => { getMemberConnectionsList().then((res: { data: ConnectionsProp[] }) => {
connectionOptions = res.data connectionOptions.value = res.data
}) })
} }
getConnectionsList() getConnectionsList()
...@@ -70,7 +70,7 @@ const listOptions = computed(() => { ...@@ -70,7 +70,7 @@ const listOptions = computed(() => {
type: 'select', type: 'select',
prop: 'experiment_connection_id', prop: 'experiment_connection_id',
placeholder: '请选择来源链接', placeholder: '请选择来源链接',
options: connectionOptions, options: connectionOptions.value,
labelKey: 'type_name', labelKey: 'type_name',
valueKey: 'id', valueKey: 'id',
}, },
...@@ -97,24 +97,24 @@ const listOptions = computed(() => { ...@@ -97,24 +97,24 @@ const listOptions = computed(() => {
// 刷新 // 刷新
function handleRefresh() { function handleRefresh() {
appList?.refetch() appList.value?.refetch()
} }
// 导入事件弹窗 // 导入事件弹窗
const eventsVisible = $ref(false) const eventsVisible = ref(false)
// 导入用户弹窗 // 导入用户弹窗
const userVisible = $ref(false) const userVisible = ref(false)
// 新建、更新、查看 // 新建、更新、查看
let updateVisible = $ref(false) const updateVisible = ref(false)
// 新建、更新、查看 // 新建、更新、查看
const progressVisible = $ref(false) const progressVisible = ref(false)
let multipleSelection = $ref<MemberProp[]>([]) const multipleSelection = ref<MemberProp[]>([])
function handleSelectionChange(selection: MemberProp[]) { function handleSelectionChange(selection: MemberProp[]) {
multipleSelection = selection multipleSelection.value = selection
} }
// 删除 // 删除
...@@ -132,7 +132,7 @@ const handleRemove = function (row: { id: string; have_event: boolean }) { ...@@ -132,7 +132,7 @@ const handleRemove = function (row: { id: string; have_event: boolean }) {
} }
} }
const handleRemoves = function (isAll?: boolean) { const handleRemoves = function (isAll?: boolean) {
const ids = multipleSelection.map((item) => item.id).join(',') const ids = multipleSelection.value.map((item) => item.id).join(',')
if (isAll) { if (isAll) {
ElMessageBox.confirm('确定要删除全部用户数据吗?', '提示', { ElMessageBox.confirm('确定要删除全部用户数据吗?', '提示', {
confirmButtonText: '确认', confirmButtonText: '确认',
...@@ -152,15 +152,15 @@ const handleRemoves = function (isAll?: boolean) { ...@@ -152,15 +152,15 @@ const handleRemoves = function (isAll?: boolean) {
} }
} }
let loading = $ref<any>() const loading = ref<any>()
const deleteMembers = function (params: any) { const deleteMembers = function (params: any) {
loading = ElLoading.service({ loading.value = ElLoading.service({
lock: true, lock: true,
text: 'Loading', text: 'Loading',
background: 'rgba(0, 0, 0, 0.7)', background: 'rgba(0, 0, 0, 0.7)',
}) })
deleteMember(params).then(() => { deleteMember(params).then(() => {
loading.close() loading.value.close()
ElMessage({ message: '删除成功', type: 'success' }) ElMessage({ message: '删除成功', type: 'success' })
handleRefresh() handleRefresh()
}) })
...@@ -171,19 +171,19 @@ const currentRow = ref<MemberProp>() ...@@ -171,19 +171,19 @@ const currentRow = ref<MemberProp>()
const handleEdit = function (row: MemberProp) { const handleEdit = function (row: MemberProp) {
currentRow.value = row currentRow.value = row
row.isView = false row.isView = false
updateVisible = true updateVisible.value = true
} }
// 查看 // 查看
const handleView = function (row: MemberProp) { const handleView = function (row: MemberProp) {
row.isView = true row.isView = true
currentRow.value = row currentRow.value = row
updateVisible = true updateVisible.value = true
} }
// 新建 // 新建
const handleAdd = function () { const handleAdd = function () {
updateVisible = true updateVisible.value = true
currentRow.value = undefined currentRow.value = undefined
} }
...@@ -205,7 +205,7 @@ const handleImage = function (row: MemberProp) { ...@@ -205,7 +205,7 @@ const handleImage = function (row: MemberProp) {
// 导出用户 // 导出用户
const downloadMember = function (isAll?: boolean) { const downloadMember = function (isAll?: boolean) {
const ids = multipleSelection const ids = multipleSelection.value
.reduce((a: any, b: any) => { .reduce((a: any, b: any) => {
a.push(b.id) a.push(b.id)
return a return a
......
...@@ -3,7 +3,7 @@ export interface Dictionary { ...@@ -3,7 +3,7 @@ export interface Dictionary {
value: string | number value: string | number
} }
export function getNameByValue(value: string | number | Array<string | number>, list: Dictionary[]) { export function getNameByValue(value: string | number | Array<string | number>, list: Dictionary[]): string | number {
if (Array.isArray(value)) { if (Array.isArray(value)) {
return value return value
.map((item) => getNameByValue(item, list)) .map((item) => getNameByValue(item, list))
......
...@@ -2,14 +2,13 @@ ...@@ -2,14 +2,13 @@
"extends": "@vue/tsconfig/tsconfig.dom.json", "extends": "@vue/tsconfig/tsconfig.dom.json",
"include": ["auto-imports.d.ts", "env.d.ts", "src/**/*", "src/**/*.vue"], "include": ["auto-imports.d.ts", "env.d.ts", "src/**/*", "src/**/*.vue"],
"compilerOptions": { "compilerOptions": {
"composite": true, "incremental": true,
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
"allowJs": true, "allowJs": true,
"baseUrl": ".",
"paths": { "paths": {
"@/*": ["./src/*"] "@/*": ["./src/*"]
}, },
"types": ["element-plus/global", "@vue-macros/reactivity-transform/macros-global"] "types": ["element-plus/global"]
} }
} }
...@@ -4,25 +4,12 @@ import { fileURLToPath, URL } from 'node:url' ...@@ -4,25 +4,12 @@ import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite' import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue' import vue from '@vitejs/plugin-vue'
import checker from 'vite-plugin-checker'
import AutoImport from 'unplugin-auto-import/vite' import AutoImport from 'unplugin-auto-import/vite'
import ReactivityTransform from '@vue-macros/reactivity-transform/vite'
import mkcert from 'vite-plugin-mkcert' import mkcert from 'vite-plugin-mkcert'
export default defineConfig(({ mode }) => ({ export default defineConfig(({ mode }) => ({
base: mode === 'prod' ? 'https://webapp-pub.ezijing.com/website/prod/saas-dml/' : '/', base: mode === 'prod' ? 'https://webapp-pub.ezijing.com/website/prod/saas-dml/' : '/',
plugins: [ plugins: [
{
name: 'school-local-assets',
transformIndexHtml(html) {
if (mode !== 'school') return html
return html
.replace('https://zws-imgs-pub.ezijing.com/pc/base/favicon.ico', '/favicon.ico')
.replace('https://webapp-pub.ezijing.com/screenshot.js', '/screenshot.js')
.replace('https://webapp-pub.ezijing.com/plugins/tinymce@6/tinymce.min.js', '/lib/tinymce@6/tinymce.min.js')
.replace(/\s*<script src="https:\/\/webapp-pub.ezijing.com\/plugins\/sky-agents\/[^\"]+"><\/script>/, '')
},
},
mkcert(), mkcert(),
vue(), vue(),
AutoImport({ AutoImport({
...@@ -30,8 +17,6 @@ export default defineConfig(({ mode }) => ({ ...@@ -30,8 +17,6 @@ export default defineConfig(({ mode }) => ({
dts: true, dts: true,
eslintrc: { enabled: true }, eslintrc: { enabled: true },
}), }),
ReactivityTransform(),
checker({ vueTsc: true, eslint: { useFlatConfig: true, lintCommand: 'eslint "./src/**/*.{vue,js,jsx,ts,tsx}"' } }),
], ],
server: { server: {
open: true, open: true,
...@@ -84,9 +69,4 @@ export default defineConfig(({ mode }) => ({ ...@@ -84,9 +69,4 @@ export default defineConfig(({ mode }) => ({
'@': fileURLToPath(new URL('./src', import.meta.url)), '@': fileURLToPath(new URL('./src', import.meta.url)),
}, },
}, },
css: {
preprocessorOptions: {
scss: { api: 'modern-compiler' },
},
},
})) }))
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论