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

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

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