Commit 15592f93 by haojie

1

parent 56d408ab
import { getLocalData, setLocalData } from '@/utils/tool'; import { getLocalData, setLocalData } from '@/utils/tool';
import router from '@/router'; import router from '@/router';
import { show_message } from '@/utils/tdesign_tool'; import { show_message } from '@/utils/tdesign_tool';
// 语言列表
export const voice_list = [
{
label: '柜姐',
value: 'guijie',
},
{
label: '小仙',
value: 'xiaoxian',
},
{
label: '艾飞',
value: 'aifei',
},
{
label: '老铁',
value: 'laotie',
},
{
label: '老妹',
value: 'laomei',
},
];
// 清空admin-form的value值 // 清空admin-form的value值
export const ResetForm = (list: any[]) => { export const ResetForm = (list: any[]) => {
list.forEach((item: any) => { list.forEach((item: any) => {
...@@ -26,7 +50,7 @@ export const getFilterParams = (list: any[]) => { ...@@ -26,7 +50,7 @@ export const getFilterParams = (list: any[]) => {
export const EditButtonEvent = (key: string, path: string, row: any) => { export const EditButtonEvent = (key: string, path: string, row: any) => {
if (key && path) { if (key && path) {
// 行数据存本地 // 行数据存本地
setLocalData(key, JSON.stringify(row), 'session'); setLocalData(key, row, 'session');
router.push({ router.push({
path: path, path: path,
}); });
...@@ -57,10 +81,10 @@ export const EditFillData = (form: any[], row: any) => { ...@@ -57,10 +81,10 @@ export const EditFillData = (form: any[], row: any) => {
// 查找name相同的字段 // 查找name相同的字段
Object.keys(row).forEach((key: string) => { Object.keys(row).forEach((key: string) => {
// console.log(value); // console.log(value);
console.log(it.name);
if (it.name == key) { if (it.name == key) {
console.log(it.name);
// 填充数据 // 填充数据
it.value = row[key]; it.value = row[key] + '';
} }
}); });
}); });
......
...@@ -7,6 +7,7 @@ import PageEdit from '@/components/Admin/PageEdit.vue'; ...@@ -7,6 +7,7 @@ import PageEdit from '@/components/Admin/PageEdit.vue';
import { reactive } from 'vue'; import { reactive } from 'vue';
import { getLocalData, isDevContext } from '@/utils/tool'; import { getLocalData, isDevContext } from '@/utils/tool';
import { show_message } from '@/utils/tdesign_tool'; import { show_message } from '@/utils/tdesign_tool';
import { voice_list } from '@/constants/admin_form';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
const router = useRouter(); const router = useRouter();
const imgs = { const imgs = {
...@@ -89,28 +90,7 @@ const ManagementForm = reactive({ ...@@ -89,28 +90,7 @@ const ManagementForm = reactive({
placeholder: '请选择语音', placeholder: '请选择语音',
value: '', value: '',
align: 'left', align: 'left',
options: [ options: voice_list,
{
label: '柜姐',
value: 'guijie',
},
{
label: '小仙',
value: 'xiaoxian',
},
{
label: '艾飞',
value: 'aifei',
},
{
label: '老铁',
value: 'laotie',
},
{
label: '老妹',
value: 'laomei',
},
],
}, },
{ {
type: 'textarea', type: 'textarea',
......
...@@ -9,7 +9,11 @@ import { discourse_management_edit } from '@/constants/token'; ...@@ -9,7 +9,11 @@ import { discourse_management_edit } from '@/constants/token';
import { getLocalData, isDevContext } from '@/utils/tool'; import { getLocalData, isDevContext } from '@/utils/tool';
import { show_message } from '@/utils/tdesign_tool'; import { show_message } from '@/utils/tdesign_tool';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { getEditLocalData, EditFillData } from '@/constants/admin_form'; import {
getEditLocalData,
EditFillData,
voice_list,
} from '@/constants/admin_form';
const router = useRouter(); const router = useRouter();
const imgs = { const imgs = {
fill: new URL('../../../assets/svg/form/edit.svg', import.meta.url).href, fill: new URL('../../../assets/svg/form/edit.svg', import.meta.url).href,
...@@ -75,7 +79,7 @@ const ManagementForm = reactive({ ...@@ -75,7 +79,7 @@ const ManagementForm = reactive({
{ {
type: 'select', type: 'select',
label: '语言', label: '语言',
name: 'language_1', name: 'language',
placeholder: '请选择语言', placeholder: '请选择语言',
value: '', value: '',
align: 'left', align: 'left',
...@@ -97,16 +101,7 @@ const ManagementForm = reactive({ ...@@ -97,16 +101,7 @@ const ManagementForm = reactive({
placeholder: '请选择语音', placeholder: '请选择语音',
value: '', value: '',
align: 'left', align: 'left',
options: [ options: voice_list,
{
label: '小微 (直播间专属)',
value: '123',
},
{
label: '小爱 (直播间专属)',
value: '12345',
},
],
}, },
{ {
type: 'textarea', type: 'textarea',
...@@ -125,7 +120,6 @@ onBeforeMount(() => { ...@@ -125,7 +120,6 @@ onBeforeMount(() => {
discourse_management_edit, discourse_management_edit,
ManagementForm.back_url ManagementForm.back_url
); );
console.log(row);
// 填充数据 // 填充数据
EditFillData(ManagementForm.form_options, row); EditFillData(ManagementForm.form_options, row);
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment